请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Chrome failed to start: exited abnormally

场景描述:
使用chromedriver,通过代理访问目标页就报错(Linux),在本地(MAC)不报错,错误信息:

.....

    browser = webdriver.Chrome(chrome_options=chrome_pars())
  File "/usr/local/python3/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
    desired_capabilities=desired_capabilities)
  File "/usr/local/python3/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/python3/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/python3/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/python3/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
  (Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 3.10.0-1062.el7.x86_64 x86_64)

正在回答 回答被采纳积分+3

2回答

bobby 2021-03-24 10:39:23

这里报错说是无法启动chrome?你这里是不是chrome启动不了?

0 回复 有任何疑惑可以回复我~
  • 提问者 弗兰克的IT生活 #1
    今天就没出现了,相同的环境版本,相同的url,网站每天的反爬都不一样??
    回复 有任何疑惑可以回复我~ 2021-03-24 11:36:16
  • bobby 回复 提问者 弗兰克的IT生活 #2
    一般反爬都是动态的,不会写死的,比如针对ip封一般是24小时内,过了24小时就放开了
    回复 有任何疑惑可以回复我~ 2021-03-25 11:39:02
提问者 弗兰克的IT生活 2021-03-23 18:54:24

补充请求头

```

DEBUG: POST http://127.0.0.1:11827/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "chrome", "platformName": "any", "goog:chromeOptions": {"prefs": {"profile.managed_default_content_settings.images": 2}, "excludeSwitches": ["enable-automation"], "extensions": [], "args": ["--headless", "--disable-gpu", "--no-sandbox", "--disable-dev-shm-usage", "disable-web-security", "disable-infobars", "User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36", "--proxy-server=http://182.34.101.184:57114"]}}}, "desiredCapabilities": {"browserName": "chrome", "version": "", "platform": "ANY", "goog:chromeOptions": {"prefs": {"profile.managed_default_content_settings.images": 2}, "excludeSwitches": ["enable-automation"], "extensions": [], "args": ["--headless", "--disable-gpu", "--no-sandbox", "--disable-dev-shm-usage", "disable-web-security", "disable-infobars", "User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36", "--proxy-server=http://182.34.101.184:57114"]}}}

```

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信