作者areyo (沒有名字的怪物)
看板Python
標題[問題] Selenium開啟Chrome - headless
時間Wed Dec 30 22:45:18 2020
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
推 fotumbra: 改第1行看看 chromeOptions =webdriver.ChromeOptions() 12/31 09:27
推 mychiux413: 我Options的import是 webdriver.chrome.options.Opti 12/31 13:07
→ mychiux413: ons,這樣在linux是正常的 12/31 13:07