[英]Unable to add more than 20 extensions on 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" , 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
我究竟做錯了什么? 我怎樣才能繞過這個 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.