Traceback (most recent call last):
File "E:\word\Pythonwork\work\work.py", line 12, in
driver = webdriver.Chrome(service=driver_service)
File "C:\Users\jn176\AppData\Roaming\Python\Python39\site-packages\selenium\webdriver\chrome\webdriver.py", line 70, in init
super(WebDriver, self).init(DesiredCapabilities.CHROME['browserName'], "goog",
File "C:\Users\jn176\AppData\Roaming\Python\Python39\site-packages\selenium\webdriver\chromium\webdriver.py", line 90, in init
self.service.start()
File "C:\Users\jn176\AppData\Roaming\Python\Python39\site-packages\selenium\webdriver\common\service.py", line 103, in start
sleep(0.5)
KeyboardInterrupt
代码
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
driver_service = Service(executable_path=r"E:\word\Google\Chrome\Application\chrome.exe")
driver = webdriver.Chrome(service=driver_service)
driver.get('https://www.baidu.com')