【问题标题】:python undetected chromedriver fail to runpython 未检测到的 chromedriver 无法运行
【发布时间】:2022-11-30 20:18:32
【问题描述】:

我正在使用 selenium 废弃一个网站,但我一直都被检测到。我决定使用Undetected chromedriver。但我收到以下错误

Traceback (most recent call last):
  File "undt.py", line 746, in <module>
    booter()
  File "undt.py", line 92, in booter
    driver = uc.Chrome(options=option)
  File "C:\Users\azureuser\AppData\Local\Programs\Python\Python37-32\lib\site-packages\undetected_chromedriver\__init__.py", line 414, in __init__
    close_fds=IS_POSIX,
  File "C:\Users\azureuser\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "C:\Users\azureuser\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1148, in _execute_child
    args = list2cmdline(args)
  File "C:\Users\azureuser\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 555, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'NoneType' is not iterable

我的代码很简单

from selenium import webdriver
import undetected_chromedriver as uc

option = webdriver.ChromeOptions()
option.add_experimental_option("excludeSwitches", ["enable-automation", "enable-logging"])
driver = uc.Chrome(options=option)

注意:我正在运行 python 版本 3.7.9 32bit

【问题讨论】:

  • 但我总是被发现:您是否在 Stack Overflow 中寻找过解决方案?
  • 发个网址看看。
  • @undetectedSelenium 我尝试了我能找到的一切;随机用户代理,添加用户配置文件,代理...
  • @AbiSaran 这是网站:tempail.com

标签: python selenium undetected-chromedriver


【解决方案1】:

试试下面的代码,它的工作:

from selenium import webdriver
import undetected_chromedriver as uc

driver = uc.Chrome(use_subprocess=True)
driver.maximize_window()

driver.get("https://tempail.com/")

【讨论】: