運行我的代碼時,我得到以下錯誤字串,
<string>:36: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
可能是什么問題?下面是 Selenium 設定,
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')
uj5u.com熱心網友回復:
此錯誤訊息
DeprecationWarning: executable_path has been deprecated, please pass in a Service object
意味著該密鑰 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)
有關更多詳細資訊,請參見此處
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/444111.html
標籤:Python 硒 硒网络驱动程序 网页抓取 硒铬驱动程序
上一篇:PythonSelenium:按部分文本查找行,然后單擊該部分文本沒有識別符號的復選框
下一篇:硒回圈通過單選按鈕python
