Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.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
Selenium webdriver 在Python中使用Selenium chromedriver测试安全浏览_Selenium Webdriver_Selenium Chromedriver_Safe Browsing - Fatal编程技术网

Selenium webdriver 在Python中使用Selenium chromedriver测试安全浏览

Selenium webdriver 在Python中使用Selenium chromedriver测试安全浏览,selenium-webdriver,selenium-chromedriver,safe-browsing,Selenium Webdriver,Selenium Chromedriver,Safe Browsing,我正在尝试使用selenium chromedriver访问著名的安全浏览红色错误页面,但没有成功-尝试了我能找到的所有标志/首选项 有什么建议/想法吗 下面是我的代码(python): 谢谢 prefs = {"directory_upgrade": True, "safebrowsing": {"enabled": True, "malware": {"enabled": True}}, "alternate_error_pages": True, "browser"

我正在尝试使用selenium chromedriver访问著名的安全浏览红色错误页面,但没有成功-尝试了我能找到的所有标志/首选项

有什么建议/想法吗

下面是我的代码(python):

谢谢

prefs = {"directory_upgrade": True,
    "safebrowsing": {"enabled": True, "malware": {"enabled": True}},
    "alternate_error_pages": True,
    "browser": {"safebrowsing": {"enabled": True, "malware":"enabled": True}}},
    }

exclude_default_swithes = ["disable-client-side-phishing-detection",
    "safebrowsing-disable-auto-update",
    "safebrowsing-disable-download-protection",
    "ignore-certificate-errors",]

options = webdriver.ChromeOptions()
options.add_experimental_option("prefs", prefs)
options.add_experimental_option("excludeSwitches", exclude_default_swithes)

driver = webdriver.Chrome(executable_path=path, chrome_options=options, service_log_path=log_path)