Board logo

標題: python selenium browser 問題 [打印本頁]

作者: bongbong3481    時間: 2023-8-18 19:13     標題: python selenium browser 問題

學緊python selenium,  發覺chrome 更新到最新版,d code 就run 吾到。

請問除左重裝舊版外,有冇其它方法?
作者: KinChungE    時間: 2023-8-19 23:01

你邊句code run唔到先?
冇code冇人知咩事
作者: sinsinking    時間: 2023-8-19 23:58

回覆 1# bongbong3481

115 未有chrome driver, 用chromium 114 就ok
https://chromedriver.chromium.org/downloads
作者: tragamer    時間: 2023-8-20 20:59

本帖最後由 tragamer 於 2023-8-20 21:02 編輯

我係colab
run到
好似內置咗

!pip install selenium

from selenium import webdrive

options = webdriver.ChromeOptions()
options.add_argument("--headless")
options.add_argument('--disable-dev-shm-usage')
options.add_argument("--no-sandbox")

driver = webdriver.Chrome(
    options=options
)

電腦就唔知
作者: bongbong3481    時間: 2023-8-21 19:10

你邊句code run唔到先?
冇code冇人知咩事
KinChungE 發表於 2023-8-19 23:01


出左以下error, 應該是chrome 太新

Error getting version of chromedriver 116. Retrying with chromedriver 115 (attempt 1/5)

Error getting version of chromedriver 115. Retrying with chromedriver 114 (attempt 2/5)

...

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114

Current browser version is 116.0.5845.97 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
作者: bongbong3481    時間: 2023-8-21 19:12

回覆 4# tragamer


   
原來有colab 呢樣野,仲可以玩selenium?  咁幾方便,有部平板就學到了
作者: Super169    時間: 2023-8-21 23:56

回覆 5# bongbong3481


115 之後, 要去呢度 download:
https://googlechromelabs.github.io/chrome-for-testing/#stable





歡迎光臨 電腦領域 HKEPC Hardware (https://www.hkepc.com/forum/) Powered by Discuz! 7.2