取消
顯示的結果
而不是尋找
你的意思是:

在磚使用硒鉻司機,但失敗之後,第一次運行

Tripalink
新的貢獻者三世

我有一個筆記本使用Selenium Web司機Chrome和它是我第一次運行筆記本。如果我再次運行筆記本,它不會工作,給了錯誤信息:

WebDriverException:消息:未知錯誤:無法發現打開的頁麵加亮:# 0 0 x560b13ce5e89 <未知>

這裏的代碼導致錯誤信息:

chromedriver_path = ' / local_disk0 / tmp / chromedriver '

chromebinary_path = / usr / bin / google chrome的

s =服務(ChromeDriverManager () . install ())

選項=選項()

選項。binary_location = chromebinary_path

options.add_argument (“——disable-gpu”)

options.add_argument (“——no-sandbox”)

# options.add_argument (——remote-debugging-port = 9222)

options.add_argument (”——remote-debugging-port = 9230”)

options.add_argument (“——disable-dev-shm-usage”)

選項。無頭= True

司機= webdriver。鉻(service=s, options=options)

同時,年底我筆記本下麵的代碼可能是問題的一部分,不確定:

driver.stop_client ()

driver.close ()

driver.quit ()

s.stop ()

我能改變什麼能夠運行筆記本多少次我想沒有給出錯誤消息。

2回答2

Tripalink
新的貢獻者三世

這是我發現的解決方案:

s =服務(chromedriver_path)

最後的筆記本我運行:

driver.quit ()

我擺脫了driver.stop_client (), driver.close(),和s.stop ()

driver.quit()關閉所有瀏覽器窗口和停止司機並允許我再次運行腳本,而無需重新啟動集群。

Hubert_Dudek1
尊敬的貢獻者三世

嗨,@Dagart埃裏森。我創建了一個新版本的硒與磚手冊。請在這裏https://community.m.eheci.com/s/feed/0D58Y00009SWgVuSAL

歡迎來到磚社區:讓學習、網絡和一起慶祝

加入我們的快速增長的數據專業人員和專家的80 k +社區成員,準備發現,幫助和合作而做出有意義的聯係。

點擊在這裏注冊今天,加入!

參與令人興奮的技術討論,加入一個組與你的同事和滿足我們的成員。

Baidu
map