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

时间:2015-08-10 09:50:31

标签: selenium-webdriver selenium-chromedriver safe-browsing

我试图使用selenium chromedriver到达着名的安全浏览红色错误页面但没有成功 - 尝试了我能找到的每个标志/ pref ......

有任何建议/想法吗?

继承我的代码(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)

谢谢!

0 个答案:

没有答案