![](/img/trans.png)
[英]Unknown Python Selenium error:Traceback (most recent call last): File "D:\pythonProject\webscraping.py", line 17, in <module>
[英]Traceback (most recent call last): File "D:\Python\PLAY.PY", line 29, in <module>
在此代码中需要帮助
Traceback (most recent call last):
File "D:\Python\PLAY.PY", line 29, in <module>
driver = webdriver.Chrome('D:\Python\chromedriver.exe', desired_capabilities=capa, options=options) # Arguments
File "C:\Users\Virus\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__
RemoteWebDriver.__init__(
File "C:\Users\Virus\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\Virus\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\Virus\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Virus\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Failed to create Chrome process.
你需要养成逃避反斜杠的习惯。 使用以下选项之一:
driver = webdriver.Chrome('D:\\Python\\chromedriver.exe',desired_capabilities=capa, options=options)
driver = webdriver.Chrome(r'D:\Python\chromedriver.exe',desired_capabilities=capa, options=options)
driver = webdriver.Chrome('D:/Python/chromedriver.exe',desired_capabilities=capa, options=options)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.