在运行我的代码时,我得到以下错误字符串,
<string>:36: DeprecationWarning: executable_path has been deprecated, please pass in a Service object可能会有什么问题?下面是硒的设置,
options = webdriver.ChromeOptions()
prefs = {"download.default_directory" : wd}
options.add_experimental_option("prefs", prefs)
options.add_argument("--headless")
path = (chrome)
driver = webdriver.Chrome(executable_path=path, options = options)
driver.get('https://www.1linelogin.williams.com/1Line/xhtml/login.jsf?BUID=80')发布于 2022-03-15 13:01:54
此错误消息
DeprecationWarning: executable_path已被废弃,请传入服务对象
这意味着关键的executable_path将在即将发布的版本中被废弃。
一旦不推荐键executable_path,就必须使用Service()类的一个实例,如下所示:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
path = (chrome)
s = Service(path)
driver = webdriver.Chrome(service=s)有关详细信息,请参阅here
发布于 2022-11-22 15:08:42
DeprecationWarning: executable_path已被废弃,请传入一个服务对象
在这种情况下,它必须传递服务对象。
from selenium.webdriver.chrome.service import Service
service = Service("path of execution")
driver = webdriver.Chrome(service=service)从这一点来看,它将发挥作用。
https://stackoverflow.com/questions/71482512
复制相似问题