我正在尝试使用硒打开下面代码的网页
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('bing.com')
我尝试使用executable_path=
,但是它说chromedriver needs to be in PATH
,所以我将驱动程序添加到路径变量中
我认为那不是问题
我也正在使用WSL2
这是完整的错误
Traceback (most recent call last):
File "/mnt/d/project/src/main.py", line 9, in <module>
driver = webdriver.Chrome()
File "/home/amirhosein/.local/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
self.service.start()
File "/home/amirhosein/.local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 98, in start
self.assert_process_still_running()
File "/home/amirhosein/.local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 109, in assert_process_still_running
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Service chromedriver unexpectedly exited. Status code was: 1