selenium怎么打开Chrome并且能设置代理
导读:selenium怎么打开Chrome并且能设置代理?from selenium import webdriver# 设置代理chromeOptions = webdriver.ChromeOptions( chromeOptions.add...
selenium怎么打开Chrome并且能设置代理?
from selenium import webdriver
# 设置代理
chromeOptions = webdriver.ChromeOptions()
chromeOptions.add_argument('--proxy-server=http://ip:port')
driver = webdriver.Chrome(chrome_options=chromeOptions)
# 使用
driver.get("http://www.toutiao.com/")
print(browser.page_source)
# 退出,清除浏览器缓存
driver.quit()
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: selenium怎么打开Chrome并且能设置代理
本文地址: https://pptw.com/jishu/63080.html
