6_7 selenium使用代理IP

 1 """"""
 2 
 3 from selenium import webdriver
 4 
 5 driver_path = r"D:\install\chromedriver\chromedriver.exe"
 6 options = webdriver.ChromeOptions()
 7 options.add_argument("--proxy-server=http://代理IP:31032")
 8 
 9 driver = webdriver.Chrome(executable_path=driver_path, options=options)
10 
11 driver.get('http://httpbin.org/ip')

猜你喜欢

转载自www.cnblogs.com/sruzzg/p/13170844.html
今日推荐