python selenium怎么配置IE和chrome的代理,求代码
1个回答
展开全部
from selenium import webdriver
import os,time
chromedriver =os.getcwd()+'\\chromedriver.exe'
os.environ['webdriver.Chrome.driver']=chromedriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--proxy-server=211.147.240.86:808')
driver = webdriver.Chrome(chromedriver,chrome_options=chrome_options)
import os,time
chromedriver =os.getcwd()+'\\chromedriver.exe'
os.environ['webdriver.Chrome.driver']=chromedriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--proxy-server=211.147.240.86:808')
driver = webdriver.Chrome(chromedriver,chrome_options=chrome_options)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询