Python爬虫類Selenium駆動Chromeエラーselenium.exceptions.WebDriver Exception:Message

3576 ワード

プログラムコード:
from selenium import webdriver


url = "http://www.baidu.com"
driver = webdriver.Chrome()
driver.get(url=url)
実行後のエラー:
selenium.common.exceptions.WebDriverException: Message: unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"7A06D5022B2C8796268ABF79AE246C45","isDefault":true},"id":1,"name":"","origin":"://"}
  (Session info: chrome=69.0.3497.81)
  (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64)
ブラウザのスクリーンショット:Python爬虫 Selenium驱动Chrome报错selenium.common.exceptions.WebDriverException: Message_第1张图片
このエラーのほとんどはブラウザとドライバのバージョンが一致しないためです.
  • ブラウザバージョンを見ると、最新の69バージョン
  • があります.
    chrome://settings/help
    Python爬虫 Selenium驱动Chrome报错selenium.common.exceptions.WebDriverException: Message_第2张图片2.googleドライバの対応するバージョン関係を確認する
    https://sites.google.com/a/chromium.org/chromedriver/downloads
    Python爬虫 Selenium驱动Chrome报错selenium.common.exceptions.WebDriverException: Message_第3张图片3.2.41バージョンの駆動をダウンロードし、解凍して、chromeブラウザのインストールディレクトリの下に置いてください.
    C:\Program Files (x86)\Google\Chrome\Application
    プログラムコードの再実行:Python爬虫 Selenium驱动Chrome报错selenium.common.exceptions.WebDriverException: Message_第4张图片