3.真正弄懂原理才能真正解决问题,总是照猫画虎到关键时刻会吃亏。
---------------------------------------------------------------------------------------------
补充:
@吴穹adam 提供了两篇文章:
Webdriver的高级用法:
给出了用程序显式设置proxy的方法:
from selenium import webdriver PROXY = "localhost:8080" webdriver.DesiredCapabilities.INTERNETEXPLORER['proxy'] = { "httpProxy":PROXY, "ftpProxy":PROXY, "sslProxy":PROXY, "noProxy":None, "proxyType":"MANUAL", "class":"org.openqa.selenium.Proxy", "autodetect":False } # you have to use remote, otherwise you'll have to code it yourself in python to # dynamically changing the system proxy preferences driver = webdriver.Remote("http://localhost:4444/wd/hub", webdriver.DesiredCapabilities.INTERNETEXPLORER)
一个哥们类似问题的解决方法:
http://passerbyy.iteye.com/blog/1286292
自己只看了COM互操作的源码,原来在外层是可以设置Proxy的。得继续深入学习。