簡體   English   中英

Selenium 中的 WebDriverException 使用 python 3

[英]WebDriverException in Selenium using python 3

我在 Windows 上使用 python 3,使用 Selenium 包使用 Chrome 進行網絡爬蟲。 我在一台新電腦上運行,一切都一樣,但在第一次運行時立即出現以下錯誤。 我從未見過這個例外。 任何人都熟悉它並且可以解釋一下嗎? 謝謝。

    WebDriverException: session not created exception
    from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"9668.1","isDefault":true},"id":1,"name":"","origin":"://"}
      (Session info: chrome=54.0.2840.71)
      (Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.3.9600 x86_64)

異常立即發生在驅動程序調用的開頭:

    driver = webdriver.Chrome()

更新:升級到 chromeDriver2.4 后,出現了一個我以前從未見過的錯誤:

WebDriverException:未知錯誤:無法發現打開的頁面(驅動程序信息:chromedriver=2.4.226107,平台=Windows NT 6.1 SP1 x86_64)

有任何想法嗎?? 謝謝...

確保更新到最新的驅動程序。 我遇到了同樣的問題——正在使用 2.22 並更新到 2.24。 解決了這個問題。

有關最新驅動程序,請參見此處:(單擊最新版本) http://chromedriver.storage.googleapis.com/index.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM