简体   繁体   English

未检测到的 Chromedriver 意外崩溃

[英]Undetected Chromedriver Crashing Unexpectedly

I'm trying to create a program that logs into google by using undetected-chromedriver.我正在尝试创建一个使用 undetected-chromedriver 登录谷歌的程序。 I'm running this on Replit but it crashes directly after opening google.我在 Replit 上运行它,但打开谷歌后它直接崩溃。

import undetected_chromedriver as uc

chrome_options = uc.ChromeOptions()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')

driver = uc.Chrome(options=chrome_options)
driver.get('https://mail.google.com')

This is the error that it returns:这是它返回的错误:

Traceback (most recent call last):
  File "main.py", line 7, in <module>
    driver = uc.Chrome(options=chrome_options)
  File "/home/runner/Undetected-Chromedriver/venv/lib/python3.8/site-packages/undetected_chromedriver/__init__.py", line 401, in __init__
    super(Chrome, self).__init__(
  File "/home/runner/Undetected-Chromedriver/venv/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/home/runner/Undetected-Chromedriver/venv/lib/python3.8/site-packages/selenium/webdriver/chromium/webdriver.py", line 89, in __init__
    self.service.start()
  File "/home/runner/Undetected-Chromedriver/venv/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 98, in start
    self.assert_process_still_running()
  File "/home/runner/Undetected-Chromedriver/venv/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 110, in assert_process_still_running
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Service /home/runner/.local/share/undetected_chromedriver/36af9f1b1cb26672_chromedriver unexpectedly exited. Status code was: 127

screen output屏幕output

Is there a fix to this problem or another method that can get me logged into Google?是否有解决此问题的方法或可以让我登录 Google 的其他方法?

i am also facing same issue.我也面临同样的问题。 try this its work for me试试这个它对我的工作

import undetected_chromedriver as uc
    
def browser():
    chrome_options = uc.ChromeOptions()
    chrome_options.add_argument('--no-sandbox')
    chrome_options.add_argument('--disable-dev-shm-usage')
    if __name__ == '__main__':
         driver = uc.Chrome(options=chrome_options)
         driver.get('https://mail.google.com')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM