selenium chrom http代理加改ua

2019/01 03 09:01
# selenium chrom http代理加改ua
from selenium import webdriver
chromeOptions = webdriver.ChromeOptions()
ua='Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A403 MicroMessenger/6.3.27 NetType/WIFI Language/zh_CN'
proxys="--proxy-server=http://118.89.150.117:1080"
chromeOptions.add_argument(proxys)
chromeOptions.add_argument('user-agent='+ ua)
browser = webdriver.Chrome(chrome_options = chromeOptions)
browser.get('http://132.232.249.247:81/ip')
browser.quit()
print(browser.page_source)

--转载请注明: http://91o.cc/selenium-chrom-http%e4%bb%a3%e7%90%86%e5%8a%a0%e6%94%b9ua/