擅长:python、mysql、java
<pre><code>ffprofile=webdriver.FirefoxProfile()
ffprofile.set_preference('network.proxy.type', 1)
ffprofile.set_preference('network.proxy.http', HTTP_IP)
ffprofile.set_preference("network.proxy.http_port", HTTPPORT)
ffprofile.set_preference('network.proxy.socks', 'SOCKS_IP')
ffprofile.set_preference('network.proxy.socks_port', SOCKSPORT)
ffprofile.update_preferences()
driver = webdriver.Remote(
command_executor='http://SELENIUM:PORT/wd/hub',
desired_capabilities=DesiredCapabilities.FIREFOX,
browser_profile = ffprofile
)
</code></pre>