我正在尝试创建一个程序,通过使用未被检测到的chromedriver登录到谷歌。我在Replit上运行这个程序,但是它在google打开后直接崩溃。
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')这是它返回的错误:
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有没有解决这个问题的方法或者其他方法可以让我登录到谷歌呢?
发布于 2022-09-23 10:43:36
我也面临着同样的问题。试着为我做这个
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')https://stackoverflow.com/questions/72190171
复制相似问题