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的。得繼續深入學習。