Hello!
I've just started learning selenium and already run into an issue.
I try to start a session and quit it but get an error message:
(selenium_tests_env) PS C:\disk\auto\selenium_tests> python .\tests\sessions.py
C:\disk\auto\selenium_tests\tests\sessions.py:7: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
driver = webdriver.Firefox(executable_path=r'C:\WebDrivers\geckodriver.exe', options=options)
Traceback (most recent call last):
File "C:\disk\auto\selenium_tests\tests\sessions.py", line 7, in <module>
driver = webdriver.Firefox(executable_path=r'C:\WebDrivers\geckodriver.exe', options=options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\disk\auto\selenium_tests\selenium_tests_env\Lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 195, in __init__
remote_server_addr=self.service.service_url, ignore_proxy=options._ignore_local_proxy
^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Options' has no attribute '_ignore_local_proxy'
My code is:
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options
options.binary_location = r'C:\Program Files\Mozilla Firefox\firefox.exe'
driver = webdriver.Firefox(executable_path=r'C:\WebDrivers\geckodriver.exe', options=options)
driver.quit()
Any ideas are welcome.
Thank you in advance.