使用chromedriver去请求某一个以http开头的网站(如http://example.com),但是打开浏览器之后默认就去请求以https开头的网站了(如https://example.com),我应该怎么做才能保证我传入什么链接浏览器就去请求什么链接呢?下面是我部分浏览器设置
# 禁用GPU
options.add_argument('--disable-gpu')
options.add_argument('--no-sandbox')
options.add_argument('window-size=1920,1080')
# options.add_argument('--disable-dev-shm-usage')
options.add_argument('blink-settings=imagesEnabled=false')
prefs = {
"profile.managed_default_content_settings.images": 2,
"profile.default_content_setting_values": {
"automatic_downloads": 1,
"notifications": 1,
"popups": 1,
"geolocation": 1
}
}
options.add_experimental_option("prefs", prefs)
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_argument("--disable-blink-features=AutomationControlled")
options.add_argument("--disable-blink-features")
# 禁用自动化扩展程序,绕过限制
options.add_experimental_option('useAutomationExtension', False)
# 禁用 Chrome 浏览器顶部的通知栏的方法
options.add_argument('disable-infobars')
# 禁用安全警告
options.add_argument('--disable-web-security')
options.add_argument("--ignore-certificate-errors")
options.add_argument("--allow-running-insecure-content")
# 禁止自动跳转(http自动跳转成https)
options.add_argument("--disable-features=AutomaticHttpsRedirect")