我通过代理(zyte crawlera)使用 python Selenium,但是当我尝试连接到该网站时,我收到以下错误:
无法从上游获取:无法发送请求:x509:证书由未知机构签名
这是我的代码:
headless_proxy = "localhost:3128"
proxy = {
"proxyType": "manual",
"httpProxy": headless_proxy,
"ftpProxy": headless_proxy,
"sslProxy": headless_proxy,
"noProxy": "",
}
chrome_options = Options()
chrome_options.add_argument("--window-size=1920,1080") # Fenêtre grande ouverte
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--ignore-certificate-errors")
chrome_options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"])
chrome_options.add_argument("allow-running-insecure-content")
chrome_options.set_capability("proxy", proxy)
chrome_options.set_capability("acceptInsecureCerts", True)
self.driver = webdriver.Chrome(options = chrome_options)
self.driver.get("https://portail-sidep.aphp.fr/")
print(self.driver.page_source)
我运行 ChromeDriver 2.41.578700