Skip to content

Instantly share code, notes, and snippets.

@yongfook
Created October 23, 2019 04:15
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 yongfook/a86004a9ca1007c8d4af9a689ed0f1d8 to your computer and use it in GitHub Desktop.
Save yongfook/a86004a9ca1007c8d4af9a689ed0f1d8 to your computer and use it in GitHub Desktop.
Debugging Selenium / Browserless.io
caps = Selenium::WebDriver::Remote::Capabilities.chrome("goog:chromeOptions" => {
"args" => [
"--disable-background-timer-throttling",
"--disable-backgrounding-occluded-windows",
"--disable-breakpad",
"--disable-component-extensions-with-background-pages",
"--disable-dev-shm-usage",
"--disable-extensions",
"--disable-features=TranslateUI,BlinkGenPropertyTrees",
"--disable-ipc-flooding-protection",
"--disable-renderer-backgrounding",
"--enable-features=NetworkService,NetworkServiceInProcess",
"--force-color-profile=srgb",
"--hide-scrollbars",
"--metrics-recording-only",
"--mute-audio",
"--headless",
"--no-sandbox",
]
})
browserless_url = "https://#{ENV['BROWSERLESS_API_TOKEN']}@chrome.browserless.io/webdriver"
puts browserless_url
@driver = Selenium::WebDriver.for :remote, url: browserless_url, desired_capabilities: caps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment