Home » Uncategorized » selenium chrom http代理加改ua

selenium chrom http代理加改ua

# 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)