骑骡子赶猪  

测试代理地址网站:    http://httpbin.org/ip

from selenium.webdriver.chrome.options import Options
from selenium import webdriver
chrome_options = Options()
## 一定要注意,=两边不能有空格,不能是这样--proxy-server = http://202.20.16.82:10152
chrome_options.add_argument("--proxy-server=http://117.191.11.102:80")

driver = webdriver.Chrome(executable_path=r'.\chromedriver.exe', chrome_options=chrome_options)
url='http://httpbin.org/ip'
driver.get(url)

返回自己代理的ip地址
posted on 2019-08-29 09:09  骑骡子赶猪  阅读(277)  评论(0编辑  收藏  举报