Skip to content

Instantly share code, notes, and snippets.

@bltb
Created January 15, 2016 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bltb/e5dccd258b5c68a2c171 to your computer and use it in GitHub Desktop.
Save bltb/e5dccd258b5c68a2c171 to your computer and use it in GitHub Desktop.
elsif DRIVER == :phantomjs
capabilities = Selenium::WebDriver::Remote::Capabilities.phantomjs("phantomjs.page.settings.userAgent" => "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36 PerformanceMonitoringBot/0.0.2")
# XXX. exclude
case `hostname`.strip
when
"ip-172-31-26-205",
"ip-172-31-8-248" #,
# "embora"
args = []
else
log.warn("Proxy enabled")
args = ['--ignore-ssl-errors=true', '--proxy=http://localhost:9099']
end
driver = Selenium::WebDriver.for(
:phantomjs,
desired_capabilities: capabilities,
http_client: client,
args: args
)
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment