python selenium Chrome 设置为ip代理模式

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')
posted @ 2018-02-06 17:46  迷途之旅333  阅读(813)  评论(0)    收藏  举报