def test():
profile_dir = r"D:\MyChrome\Default"
# ?????
# "Referer": "http://weixin.sogou.com"
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--user-data-dir=" + os.path.abspath(profile_dir))
PROXY = "123.56.238.200:8123"
# j = random.randint(0, len(proxys)-1)
# proxy = proxys[j]
chrome_options.add_argument('--proxy-server=%s' % PROXY)
# chrome_options.add_extension('')??crx??
# service_args = ['--proxy=localhost:9050', '--proxy-type=socks5', ]
driver = webdriver.Chrome(r'C:\Python27\chromedriver', chrome_options=chrome_options)
driver.get('http://icanhazip.com')
driver.refresh()
print(driver.page_source)
driver.quit()
评论列表
文章目录