[英]python/selenium/chromedriver TimeoutException
我正在使用硒和鍍鉻的webdriver從網站上刮取pdf。 我使用以下內容,從列表中拉出site
:
driver.get(site)
source = driver.page_source
...
...
driver.quit()
但是我一直收到以下錯誤,在我的site
列表中大約有6,000個觀察結果:
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次搜索,但我應該縮短一點嗎?)。
如何延長硒的120秒超時限制?
此錯誤消息...
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實例無法與站點 url
建立連接,並且發生超時 。
您的主要問題是所使用的二進制文件之間的版本兼容性 ,如下所示:
支持Chrome v60-62
因此,您使用的ChromeDriver v2.33和Chrome瀏覽器v63.0之間明顯不匹配。 因此, ChromeDriver無法產生新的Chrome瀏覽器進程。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.