python selenium Chrome 设置为ip代理模式

时间:2018-02-06 18:57:39   收藏:0   阅读:1159
from selenium import webdriver
import os


chromedriver = ‘C:\\Users\\bxm\AppData\Local\Programs\Python\Python36\chromedriver.exe‘
chome_options = webdriver.ChromeOptions()
chome_options.add_argument(‘--proxy-server=http://110.72.42.105:8123‘)
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome(chromedriver,chrome_options=chome_options)
driver.get(‘http://httpbin.org/ip‘)

原文:https://www.cnblogs.com/chukun/p/8423370.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!