简体   繁体   English

无法在 selenium chromedriver 上添加超过 20 个扩展

[英]Unable to add more than 20 extensions on selenium chromedriver

I am using this code:我正在使用此代码:

chrome_options.add_extension(r'path to extension 1')
chrome_options.add_extension(r'path to extension 2')
...
chrome_options.add_extension(r'path to extension 20')


driver =  webdriver.Chrome(executable_path = r"C:\chromedriver.exe" , chrome_options=chrome_options)

I want to add 100 extensions to chrome for reasons, but when I add anything more than 20 extensions, I see this error:出于某些原因,我想向 chrome 添加 100 个扩展,但是当我添加超过 20 个扩展时,我看到此错误:

 driver =  webdriver.Chrome(executable_path = r"C:\chromedriver.exe" , chrome_options=chrome_options)
Traceback (most recent call last):
  File "C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 665, in urlopen
    httplib_response = self._make_request(
  File "C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 416, in _make_request
    httplib_response = conn.getresponse()
  File "C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 1322, in getresponse
    response.begin()
  File "C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 264, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\socket.py", line 669, in readinto
    return self._sock.recv_into(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

What am I doing wrong?我究竟做错了什么? How can I get around this limit of 20, and what causes this limit?我怎样才能绕过这个 20 的限制,是什么导致了这个限制?

我一直无法完全解决这个问题,但我发现 20 扩展限制以某种方式与 Windows 20 套接字限制有关: https : //forum.powerbasic.com/forum/user-to-user-discussions/programming-the -internet/771798-maximum-unique-tcp-connections-allowed-by-license-in-windows-10

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

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