Selenium DeprecationWarning: executable_path 已弃用 - 如何解决
使用以下代码替换原有的 webdriver.Chrome() 语句:
from selenium.webdriver.chrome.service import Service
chrome_driver = 'C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe'
service = Service(executable_path=chrome_driver)
driver = webdriver.Chrome(service=service, options=options)
这样就可以避免 DeprecationWarning 警告了。
原文地址: https://www.cveoy.top/t/topic/oAJM 著作权归作者所有。请勿转载和采集!