问题
I've seen that headless Chrome came out in some form last month and I've seen that it can be interacted with via Selenium but the articles I've seen mostly mention Linux and MacOS. Is this available for windows (7 and /or 10) yet?
回答1:
The Headless mode for Windows is available in Chrome 60 beta, and the stable version is likely to be also in the 60th version.
https://www.google.com/chrome/browser/beta.html
There are no differences in the launch of Selenium
回答2:
Yes, I use it on windows but with version 59 (beta) there is still an empty window popping up.
回答3:
I've been using Chrome in headless mode for months, with Chrome 59 on Windows.
My Karma config (for a custom Chrome headless) is as follows:
browsers: ['Chrome_headless'],
customLaunchers: {
Chrome_headless: {
base: 'Chrome',
flags: ['--headless', '--disable-gpu', '--disable-plugins', '--window-size=0,0', '--window-position=-9999,0']
}
},
There is no visible window with these commands.
However, updating to Chrome 60 seems to have killed this config as it no longer works (as of today)
回答4:
I am using Chromedriver headless mode with the version 2.33 with the following config for Capybara:
Capybara.register_driver :chrome_headless do |app|
args = ["--window-size=1280,1696", "--no-sandbox", "--headless", "--disable-gpu", "--disable-infobars", "--disable-notifications"]
Capybara::Selenium::Driver.new(app, {:browser => :chrome, :args => args})
end
回答5:
It's working right now in chrome 59 with chromedriver 2.31 (just released). The only annoying thing is an empty window popping up at the beginning (just a visual effect) which will be removed in chrome 60 (should be about to release)
来源:https://stackoverflow.com/questions/43880619/headless-chrome-and-selenium-on-windows