使用宝塔面板安装了python项目管理器
chrome 安装的时候安装在了 /opt/google/chrome/ 这个目录下 将chrome做了软连接到/usr/local/bin/下
chromedriver 在/usr/local/bin/ 下
使用selenium爬取数据总是提示
Traceback (most recent call last):
File "/www/wwwroot/python/index.py", line 38, in <module>
browser = webdriver.Chrome(options=chrome_options)
File "/www/wwwroot/python/damai_venv/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
desired_capabilities=desired_capabilities)
File "/www/wwwroot/python/damai_venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/www/wwwroot/python/damai_venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/www/wwwroot/python/damai_venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/www/wwwroot/python/damai_venv/lib/python3.7/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: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/local/bin/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
求大佬指导一下