<strong id="m880s"></strong>
  • <sup id="m880s"></sup>
  • <strong id="m880s"></strong>
    查看詳情

    “selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary”報錯的解決方案

    python調用selenium進行數據采集時,需要調用Google Chrome進行數據抓取,但是,調試的時候報錯了。
    cannot find Chrome binary出錯

    報錯”selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary“了,按這個意思,應該是無法調用Google Chrome瀏覽器的執行文件,解決辦法如下:
    1、確認當前的Google Chrome版本號與chromedriver版本號一致,如果不一致,到http://chromedriver.storage.googleapis.com/index.html下載與當前chrome瀏覽 器對應的驅動。
    http://selenium-release.storage.googleapis.com/index.html selenium下載地址;
    2、將chromedriver.exe文件放入python的scripts目錄,并將該scripts目錄添加到系統path變量中;
    3、找到Google Chrome安裝目錄,一般在C:\Users\Administrator\AppData\Local\Google\Chrome\Application\Google Chrome.exe,將Google Chrome.exe復制一個出來,并重命名為chrome.exe,并將目錄C:\Users\Administrator\AppData\Local\Google\Chrome\Application\添加到系統path變量中

    以上三步,基本能解決問題,網上一些帖子說在py腳本文件中加入options.binary_location=r'C:\\Users\\Administrator\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe' 指定絕對路徑,這樣挺麻煩的,治標不治本,后期你每個py腳本都要指定路徑。

    注:selenium調用chrome時,是調用chrome.exe,而不是默認的Google Chrome.exe


    原創內容,轉載請注明出處:網站建設,APP開發,小程序開發請找江西居道科技有限公司,http://www.restaurant-expo.com

    智能建站系統代理招商
    所屬分類:文章中心??????Time:2021-08-08 09:01:17??????人氣:14547
    關閉
    13517086454
    精品国产精品久久一区免费式|亚洲第一成年网站在线观看|大香伊蕉国产综合影院|天天上天天添天天爱有声
    <strong id="m880s"></strong>
  • <sup id="m880s"></sup>
  • <strong id="m880s"></strong>