我想从Glassdoor进行网页抓取。然后从https://github.com/MatthewChatham/glassdoor-review-scraper
中找到一个包我下载了版本为78.0.3904.11的chromedriver。但是当我运行python文件时,它总是说:
2019-09-29 15:57:25,182 INFO 363 :main2.py(10991) - Configuring browser
Traceback (most recent call last):
File "main2.py", line 397, in <module>
browser = get_browser()
File "main2.py", line 368, in get_browser
browser = wd.Chrome(options=chrome_options)
File "/usr/local/var/pyenv/versions/anaconda3-2019.03/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
desired_capabilities=desired_capabilities)
File "/usr/local/var/pyenv/versions/anaconda3-2019.03/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/var/pyenv/versions/anaconda3-2019.03/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/var/pyenv/versions/anaconda3-2019.03/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/var/pyenv/versions/anaconda3-2019.03/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 78
我不知道为什么...
答案 0 :(得分:0)
主要版本的chromedriver和您的Chrome浏览器需要完全匹配。因此,对于Chrome 77,应使用chromedriver 77,对于Chrome 78,应使用chromedriver78。如果版本不匹配,则需要下载与网络浏览器的主要版本匹配的chromedriver版本。
要检查版本,请执行以下操作:
Chrome浏览器:
chromedriver: