J4C3N-14
J4C3N-14

Reputation: 696

Selenium, WebDriver for Chrome Stopping the window opening

When using the WebDriver driver for Chrome a chrome window opens, and navigates to the specified page.

Is there a way to stop the window from opening?

Edit: I am using it to scrape the web page so there is no need for me to see the actual webpage. The desired behaviour would be that the scraping would be done "Silently"?

Upvotes: 1

Views: 1283

Answers (1)

alecxe
alecxe

Reputation: 473863

What you are talking about is called a headless browser.

You have several options to choose from:

  • fake a display and let selenium and a browser think you have a real one. See xvfb.
  • use PhantomJS browser
  • run your tests against BrowserStack or SauceLabs selenium servers (or have your own one)

See also:

Upvotes: 2

Related Questions