国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

selenium.common.exceptions.WebDriverException: Message: chrome not reachable解決方法

這篇具有很好參考價值的文章主要介紹了selenium.common.exceptions.WebDriverException: Message: chrome not reachable解決方法。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

問題:

  1. 在 python上使用 selenium 。
  2. 一開始還算順利,但是隨著反復執(zhí)行,處理量變多了。
  3. 如果一直等待,最終會出現(xiàn)無法訪問 chrome 的錯誤。
  4. 已經添加了driver.quit()。

解決方法:

  1. 引入一個新的函數,檢查是否有 chrome 驅動程序正在運行,并打印提示,如果有,則殺死所有chrome 驅動程序。
  2. 相當于在driver.quit()的基礎上加個保險。

代碼:

# 安裝庫:pip install psutil
import psutil
# 定義進程名稱
    process_name = 'chromedriver.exe'
    # 查找所有的Chrome驅動進程
    process_list = [process for process in psutil.process_iter() if process.name() == process_name]
    if len(process_list) > 0:
        # 如果有多個Chrome驅動程序正在運行,則殺死所有的Chrome驅動程序
        for process in process_list:
            process.kill()
        print('存在Chrome驅動程序,并且已殺死所有Chrome驅動程序')
    else:
        print('沒有Chrome驅動程序正在運行')

?文章來源地址http://www.zghlxwxcb.cn/news/detail-594930.html

到了這里,關于selenium.common.exceptions.WebDriverException: Message: chrome not reachable解決方法的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!

本文來自互聯(lián)網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉載,請注明出處: 如若內容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • selenium報錯解決:selenium.common.exceptions.WebDriverException: Message(已解決)

    selenium報錯解決:selenium.common.exceptions.WebDriverException: Message(已解決)

    今天使用selenium遇到報錯: selenium.common.exceptions.WebDriverException: Message: Service ./windows/chromedriver.exe unexpectedly exited. Status code was: 1 報錯截圖: ? 檢查了代碼沒有發(fā)現(xiàn)問題,根據報錯初步判斷問題是出在chromedriver的路徑上面,對比之前的代碼 乍一看不能發(fā)現(xiàn)問題,仔細對比發(fā)現(xiàn)是

    2024年02月11日
    瀏覽(31)
  • 解決:selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ execu

    解決:selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ execu

    運行爬蟲代碼出現(xiàn)上面的bug bug詳細信息如下 ?解決方法 如下 1.先打開chrome 輸入 “chrome://version/”來查看chrome版本 如圖我的是96 ? 2.然后訪問此網站??http://chromedriver.storage.googleapis.com/index.html?? 然后選擇合適版本的driver? ?我這邊是windows版本的系統(tǒng)所以下載? win32版本的壓縮

    2024年02月16日
    瀏覽(24)
  • 【報錯解決】selenium.common.exceptions.WebDriverException: Message: invalid argument

    【報錯解決】selenium.common.exceptions.WebDriverException: Message: invalid argument

    在做Web自動化測試的實驗報告的時候遇到一個報錯。 運行代碼: 報錯: selenium.common.exceptions.WebDriverException: Message: invalid argument (Session info: chrome=113.0.5672.92) (Driver info: chromedriver=113.0.5672.63 (0e1a4471d5ae5bf128b1bd8f4d627c8cbd55f70c-refs/branch-heads/5672@{#912}),platform=Windows NT 10.0.19044 x86_64) 這

    2024年02月05日
    瀏覽(32)
  • 已解決selenium.common.exceptions.WebDriverException: Message: invalid session id

    已解決selenium.common.exceptions.WebDriverException: Message: invalid session id

    已解決selenium循環(huán)翻頁拋出selenium.common.exceptions.WebDriverException: Message: invalid session id的正確解決方法,親測有效?。?! 粉絲群里面的一個小伙伴遇到問題跑來私信我,想用selenium循環(huán)翻頁,但是發(fā)生了報錯(當時他心里瞬間涼了一大截,跑來找我求助,然后順利幫助他解決了,

    2023年04月08日
    瀏覽(27)
  • 【python selenium報錯】selenium.common.exceptions.WebDriverException: Message: <html> 三種解決方案!

    【python selenium報錯】selenium.common.exceptions.WebDriverException: Message: <html> 三種解決方案!

    在運行python代碼時遇到該問題解決方案三種(我是第三種才解決的,總結一句話:是代理ip的問題★★★): 一、重新安裝selenium,可能是缺少某些文件 二、查看chrom的版本,在chrom驅動的官方網站中下載安裝適配的版本(版本接近即可),并將其配置到系統(tǒng)環(huán)境下,具體步驟

    2024年02月11日
    瀏覽(39)
  • Jenkins部署Python報錯 - selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executabl

    Jenkins部署Python報錯 - selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executabl

    訂閱 Python全棧白寶書-零基礎入門篇 可報銷! 白嫖入口-請點擊我。 推薦他人訂閱,可獲取扣除平臺費用后的35%收益,文末名片加V! 說明:該文屬于 Python全棧白寶書專欄, 免費階段訂閱數量4300+ , 購買任意白寶書體系化專欄可加入 TFS-CLUB 私域社區(qū)。 福利:加入社區(qū)的小伙

    2023年04月14日
    瀏覽(31)
  • 【selenium.common.exceptions.WebDriverException: Message: ‘geckodriver‘ ...】【 [WinError 2] 系統(tǒng)找不到指定的文】

    【selenium.common.exceptions.WebDriverException: Message: ‘geckodriver‘ ...】【 [WinError 2] 系統(tǒng)找不到指定的文】

    目錄 一、問題描述 二、問題分析 1、異常一: 2、異常二: 3、分析 三、解決方法 1、geckodriver的下載 2、檢查代碼 四、驗證 前言 ????????Selenium的腳本可以控制瀏覽器進行操作,可以實現(xiàn)多個瀏覽器的調用,包括 IE (7 、 8 、 9 、 10 、 11 )、 Firefox 、 Safari 、 Google Chr

    2024年02月15日
    瀏覽(18)
  • python-selenium ”selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find

    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目錄

    2024年02月04日
    瀏覽(24)
  • selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT

    selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT

    最近需要使用一下selenium,剛運行就報錯了。。。 前提準備: 1.安裝selenium 2.下載chrome對應版本的chromedriver 代碼就是一個簡單的demo: 運行報錯: 網上說要把chromedriver放到環(huán)境變量,放進去還是報錯!! 然后就直接看源碼吧: 這個過程很繁瑣,很枯燥,嫌廢話連篇請直接翻到文

    2024年01月20日
    瀏覽(15)
  • selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PAT

    selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PAT

    selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH. Please see。。。 1. 查看本機Chrome瀏覽器版本 2. 去下載chromedriver 下載地址1(我登不上去): chromedriver.storage.googleapis.com/index.html 下載地址2: https://registry.npmmirror.com/binary.html?path=chromedriver/ 找到對

    2024年02月09日
    瀏覽(28)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包