当前位置:   article > 正文

python selenium headless chrome chromedriver 等安装_driver info: chromedriver=2.7.236843,platform=linu

driver info: chromedriver=2.7.236843,platform=linux 3.10.0-1160.el7.x86_64 x

python selenium 略

chrome:

https://blog.csdn.net/zhuyiquan/article/details/79537623

6及以下版本不适用 6及以下版本不适用 6及以下版本不适用 6及以下版本不适用 6及以下版本不适用

欢迎大胆尝试,如果能用,求一定此处留名

由于key的原因安装失败,见↓

https://www.google.com/linuxrepositories/

chromedriver:

存放路径建议在: /usr/bin/{HERE}

或者代码里指定路径:

webdriver.Chrome(executable_path=path


验证整体是否可用了:

https://blog.csdn.net/dengyike1023/article/details/79014775



遇到的问题:

Traceback (most recent call last):

  File "step1.py", line 12, in <module>

    driver = webdriver.Chrome(executable_path=path,chrome_options=option)

  File "/usr/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 75, in __init__

    desired_capabilities=desired_capabilities)

  File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 156, in __init__

    self.start_session(capabilities, browser_profile)

  File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 245, in start_session

    response = self.execute(Command.NEW_SESSION, parameters)

  File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 314, in execute

    self.error_handler.check_response(response)

  File "/usr/lib/python2.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: crashed

  (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Linux 3.10.0-514.16.1.el7.x86_64 x86_64)


https://github.com/SeleniumHQ/selenium/issues/4961

加  --no-sandbox



声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/90262
推荐阅读
相关标签
  

闽ICP备14008679号