Скачайте chromedriver и распакуйте его.
from selenium import webdriver
driver = webdriver.Chrome(executable_path='/home/debian/Downloads/chromedriver')
Работает нормально. Теперь, чтобы протестировать geckodriver для firefox, моя версия firefox - 78.0.2 (64-разрядная), последняя версия, я загрузил geckodriver-v0.26.0-linux64.tar.gz
и извлек его.
from selenium import webdriver
driver = webdriver.Firefox(executable_path='/home/debian/Downloads/geckodriver')
Он обнаруживает некоторые проблемы:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
keep_alive=True)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities
Как исправить?