Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Python在Selenium中处理授权代理的使用_Python_Selenium_Https_Proxy_Proxies - Fatal编程技术网

如何使用Python在Selenium中处理授权代理的使用

如何使用Python在Selenium中处理授权代理的使用,python,selenium,https,proxy,proxies,Python,Selenium,Https,Proxy,Proxies,我读了很多关于在Selenium中使用HTTPS代理的书,并决定使用SeleniumWire,SeleniumWire非常慢。现在我正在寻找一种在Selenium中使用HTTPS代理的方法 有人能帮我吗?这可能适用于最近的Chrome: import base64 auth = base64.b64encode(b'user:pass').decode() driver.execute_cdp_cmd("Network.enable", {}) driver.execute_cdp_cmd("

我读了很多关于在Selenium中使用HTTPS代理的书,并决定使用SeleniumWire,SeleniumWire非常慢。现在我正在寻找一种在Selenium中使用HTTPS代理的方法


有人能帮我吗?

这可能适用于最近的Chrome:

import base64
auth = base64.b64encode(b'user:pass').decode()

driver.execute_cdp_cmd("Network.enable", {})
driver.execute_cdp_cmd("Network.setExtraHTTPHeaders", {"headers": {"Proxy-Authorization": "Basic " + auth}})
让我们知道它是否适合您