我正在使用 selenium 和 chrome webdriver 从网站上抓取 pdf.我使用以下内容,从列表中拉出 site
:
I'm in the process of scraping pdfs from a website using selenium and chrome webdriver. I use the following, pulling the site
from a list:
driver.get(site)
source = driver.page_source
...
...
driver.quit()
但我不断收到以下错误,我的 site
列表中有大约 6,000 次观察:
But I keep getting the following error, about 6,000 observations down my site
list:
Traceback (most recent call last):
File "<stdin>", line 127, in <module>
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 323, in get self.execute(Command.GET, {'url': url})
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 311, in execute self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: timeout
(Session info: chrome=63.0.3239.84)
(Driver info: chromedriver=2.33.506092
(733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.10.0-40-generic x86_64)
我尝试过以更短的时间间隔刷新源页面(每 200 次搜索,但我应该缩短吗?).
I've tried refreshing the source page at shorter intervals (every 200 searches, but should I go shorter?).
如何延长 selenium 的 120 秒超时限制?
How do I extend selenium's 120sec timeout limit?
这个错误信息...
Traceback (most recent call last):
File "<stdin>", line 127, in <module>
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 323, in get self.execute(Command.GET, {'url': url})
.
selenium.common.exceptions.TimeoutException: Message: timeout
(Session info: chrome=63.0.3239.84)
(Driver info: chromedriver=2.33.506092
(733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.10.0-40-generic x86_64)
...表示 webdriver 实例无法与 site url
建立连接并发生 timeout.
...implies that the webdriver instance cannot establish a connection with the site url
and timeout occurs.
您的主要问题是您使用的二进制文件之间的版本兼容性,如下所示:
Your main issue is the version compatibility between the binaries you are using as follows :
支持 Chrome v60-62
因此,您使用的 ChromeDriver v2.33 和 Chrome 浏览器 v63.0 之间存在明显的不匹配.因此 ChromeDriver 无法生成新的 Chrome 浏览器 进程.
So there is a clear mismatch between the ChromeDriver v2.33 and the Chrome Browser v63.0 you are using. Hence ChromeDriver is unable to spawn the new Chrome Browser process.
这篇关于python/selenium/chromedriver TimeoutException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!