首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未被检测到的Chromedriver意外崩溃

未被检测到的Chromedriver意外崩溃
EN

Stack Overflow用户
提问于 2022-05-10 16:47:14
回答 1查看 1.1K关注 0票数 0

我正在尝试创建一个程序,通过使用未被检测到的chromedriver登录到谷歌。我在Replit上运行这个程序,但是它在google打开后直接崩溃。

代码语言:javascript
复制
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')

这是它返回的错误:

代码语言:javascript
复制
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

屏幕输出

有没有解决这个问题的方法或者其他方法可以让我登录到谷歌呢?

EN

回答 1

Stack Overflow用户

发布于 2022-09-23 10:43:36

我也面临着同样的问题。试着为我做这个

代码语言:javascript
复制
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')
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72190171

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档