webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
print(1)
options.headless = True
print(2)
driver = webdriver.Firefox(options = options)
print(3)
driver.get('https://google.com')
print("start")
time.sleep(10)
print("ok")
driver.close()
а мне выдает ошибку
1
2
Traceback (most recent call last):
File "test.py", line 8, in <module>
driver = webdriver.Firefox(options = options)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
keep_alive=True)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: connection refused
делать? как испраивть?
ошибка в этой строке driver = webdriver.Firefox(options = options) а что не так я не понимаю
Обсуждают сегодня