Headless Chrome and Selenium on Windows?

2019-04-21 19:10发布

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?

5条回答
我欲成王,谁敢阻挡
2楼-- · 2019-04-21 19:39

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

查看更多
做个烂人
3楼-- · 2019-04-21 19:46

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)

查看更多
神经病院院长
4楼-- · 2019-04-21 19:52

Yes, I use it on windows but with version 59 (beta) there is still an empty window popping up.

查看更多
你好瞎i
5楼-- · 2019-04-21 19:53

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
查看更多
萌系小妹纸
6楼-- · 2019-04-21 19:57

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)

查看更多
登录 后发表回答