小编use*_*007的帖子

删除selenium/chromedriver传递给chrome的参数

我正在使用硒与python和铬/ chromedriver.我想删除传递给chrome的交换机(例如--full-memory-crash-report),但到目前为止我只能找到如何添加更多交换机.

我目前的设置:

from selenium import webdriver
driver = webdriver.Chrome(executable_path="/path/to/chromedriver")
driver.get(someurl)
Run Code Online (Sandbox Code Playgroud)

据我所知,这可以用来添加参数:

from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--some-switch")
driver = webdriver.Chrome(chrome_options=chrome_options)
Run Code Online (Sandbox Code Playgroud)

那么,我如何摆脱默认参数或擦除所有默认参数clean并仅传递自定义列表?

python selenium webdriver selenium-chromedriver selenium-webdriver

7
推荐指数
1
解决办法
3205
查看次数