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

Python 无法在selenium chromedriver上添加超过20个扩展,python,google-chrome-extension,selenium-chromedriver,Python,Google Chrome Extension,Selenium Chromedriver,我正在使用以下代码: 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" , chr

我正在使用以下代码:

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)
出于各种原因,我想向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

driver=webdriver.Chrome(可执行文件路径=r“C:\chromedriver.exe”,Chrome\u options=Chrome\u options)
回溯(最近一次呼叫最后一次):
文件“C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\site packages\urllib3\connectionpool.py”,urlopen中第665行
httplib\u response=self.\u发出请求(
文件“C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\site packages\urlib3\connectionpool.py”,第421行,在请求中
六、从(e,无)中提高
文件“”,第3行,从
文件“C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\site packages\urllib3\connectionpool.py”,第416行,在请求中
httplib_response=conn.getresponse()
文件“C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\http\client.py”,第1322行,在getresponse中
response.begin()
文件“C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\http\client.py”,第303行,在begin中
版本、状态、原因=self.\u读取\u状态()
文件“C:\Users\vanzw\AppData\Local\Programs\Python 38-32\lib\http\client.py”,第264行,处于读取状态
line=str(self.fp.readline(_MAXLINE+1),“iso-8859-1”)
readinto中的文件“C:\Users\vanzw\AppData\Local\Programs\Python\Python38-32\lib\socket.py”,第669行
返回自我。将袜子重新放入(b)
ConnectionAbortedError:[WinError 10053]主机中的软件中止了已建立的连接

我做错了什么?如何绕过20的限制,以及是什么导致了这个限制?

我一直无法完全解决这个问题,但我发现20扩展限制与windows 20套接字限制有某种关联: