firforx https 代理 selenium

2019/01 03 04:01

 

ip = "127.0.0.1" duankou = int(123456)#这里记得类型转换,这坑踩了2天

profile = webdriver.FirefoxProfile()

profile.set_preference('network.proxy.type',1)

profile.set_preference('network.proxy.http',"%s"%ip)

profile.set_preference('network.proxy.http_port',duankou)

profile.set_preference('network.proxy.ssl',"%s"%ip)

profile.set_preference('network.proxy.ssl_port',duankou) #profile.set_preference('general.useragent.override',uap)#设置代理头

profile.update_preferences()

driver = webdriver.Firefox(firefox_profile=profile,executable_path=os.getcwd()+'/driver/geckodriver.exe')

--转载请注明: http://91o.cc/firforx-https-%e4%bb%a3%e7%90%86-selenium/