这个警告是因为在新版本的Selenium中,'chrome_options'已经被弃用,应该使用'options'参数来代替。要解决这个警告,需要将代码中的'chrome_options'参数替换为'options'参数。例如:

options = webdriver.ChromeOptions()
options.add_argument('--headless')
driver = webdriver.Chrome(chrome_driver, options=options)

这样就不会再出现DeprecationWarning警告了。

Selenium DeprecationWarning: 使用 options 代替 chrome_options

原文地址: https://www.cveoy.top/t/topic/oAHV 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录