Skip to content

Instantly share code, notes, and snippets.

@dimacus
Created June 17, 2013 20:16
Show Gist options
  • Save dimacus/5799947 to your computer and use it in GitHub Desktop.
Save dimacus/5799947 to your computer and use it in GitHub Desktop.
#Setup Firefox profile to use proxy
profile = Selenium::WebDriver::Firefox::Profile.new
profile["network.proxy.type"] = 1
profile["network.proxy.http"] = "127.0.0.1"
profile["network.proxy.http_port"] = 9001
#Add urls to be exluded from Black Hole proxy
profile["network.proxy.no_proxies_on"] = "localhost, 127.0.0.1"
#Add profile to options
options[:profile] = profile
#Create browser
browser = Selenium::WebDriver.for :firefox, options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment