[英]After executing selenium python code google chrome closes automatically
[英]Python Selenium Chrome Webdrives closes unexpectedly after the execution of program
我已經更新了 chrome 的版本,並相應地更新了 webdriver。 執行最后一行后,chrome 會自動關閉。 這是打開 chrome 驅動程序並單擊鏈接的簡單代碼。 在我在命令提示符下運行后,它生成了錯誤消息“無法從內部尚未加載胡椒模塊(錯誤 126)” 。
因此 Pycharm 會產生錯誤“Oserror:[winerror 6] The handle is invalid”
任何人都可以請提出解決方案嗎?
我不久前(相當)經歷過這種情況。 就我而言,Chrome 需要 Adobe Flash Player 更新:在chrome://components
找到 Adobe Flash Player 條目並檢查更新。
或者,禁用擴展:
options = webdriver.ChromeOptions()
options.add_argument("--disable-extensions")
driver = webdriver.Chrome(chrome_options=options)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.