Chrome failed to start: exited abnormally

来源:9-1 selenium动态网页请求与模拟登录知乎

弗兰克的IT生活

2021-03-23

场景描述:
使用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)
写回答

2回答

bobby

2021-03-24

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

0
2
bobby
回复
弗兰克的IT生活
一般反爬都是动态的,不会写死的,比如针对ip封一般是24小时内,过了24小时就放开了
2021-03-25
共2条回复

弗兰克的IT生活

提问者

2021-03-23

补充请求头

```

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
0

Scrapy打造搜索引擎 畅销4年的Python分布式爬虫课

带你彻底掌握Scrapy,用Django+Elasticsearch搭建搜索引擎

5795 学习 · 6290 问题

查看课程