[問題] Selenium開啟Chrome - headless

看板Python作者 (沒有名字的怪物)時間4年前 (2020/12/30 22:45), 編輯推噓2(201)
留言3則, 2人參與, 4年前最新討論串1/1
code: chromeOptions = Options() chromeOptions.add_argument('--headless') #規避google bug chromeOptions.add_argument('--disable-gpu') browser = webdriver.Chrome(options=chromeOptions) or browser = webdriver.Chrome(chrome_options=chromeOptions) 卻丟出 Message: session not created: No matching capabilities found 環境windows, python3.5, chrome and chromedriver 版本一樣 若把webdriver.Chrome內的參數拿掉,就正常... -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 218.173.6.95 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1609339521.A.559.html

12/31 09:27, 4年前 , 1F
改第1行看看 chromeOptions =webdriver.ChromeOptions()
12/31 09:27, 1F

12/31 13:07, 4年前 , 2F
我Options的import是 webdriver.chrome.options.Opti
12/31 13:07, 2F

12/31 13:07, 4年前 , 3F
ons,這樣在linux是正常的
12/31 13:07, 3F
文章代碼(AID): #1Vx9A1LP (Python)
文章代碼(AID): #1Vx9A1LP (Python)