Live data from Hacker News

Chrome 59 has cross-platform headless support

chromestatus.com

121–130 of 161 posts

Re: Chrome 59 has cross-platform headless support

#121
Related: I want to take screenshots of a few news websites for a little fake news project of mine, and most approaches return something completely different than what I'm seeing when I open Chrome.

Limited height would be better/ok (something like the first 3000 pixels).

Low volume / can be slow (30 seconds would be ok).

Those news websites many times have infinite scrolling.

I've tried:

- phantomJS (rendering sucked, tried every technique I could find to wait for JS to load)

- wkhtmltopdf (almost ok, generates a huge 30M image with all the height, no antialiasing it seems)

- https://github.com/gen2brain/url2img (this was the best so far, uses Qt bindings but not the latest version)

- actually run a headless browser in DigitalOcean with xvfb-run and take a screenshot: I failed at this

What I didn't tried was Selenium, because it seemed even harder.

How would you guys do it?

Re: Chrome 59 has cross-platform headless support

#122

Earlier quoted context omitted.

We (Chrome) have reached out to PhantomJS to inquire if they're interested in collaborating: https://groups.google.com/d/msg/phantomjs-dev/S-mEBwuSgKQ/tU... The DevTools Protocol is the primary API for headless Chrome, but we are excited for higher-level abstractions like PhantomJS & NightmareJS's API to manipulate the browser as well. Plenty of details to work out, but hopefully sometime this year you'll get a drop-…

> The DevTools Protocol is the primary API for headless Chrome Why not the WebDriver protocol? That seems to be exactly what it's intended for…

WebDriver protocol has limited APIs. For example, no networking status. (WebDriver rejected to implement it, they told you to use Proxy for debugging)

Re: Chrome 59 has cross-platform headless support

#124
post #121

Related: I want to take screenshots of a few news websites for a little fake news project of mine, and most approaches return something completely different than what I'm seeing when I open Chrome. Limited height would be better/ok (something like the first 3000 pixels). Low volume / can be slow (30 seconds would be ok). Those news websites many times have infinite scrolling. I've tried: - phantomJS (rendering sucked…

[deleted]

Re: Chrome 59 has cross-platform headless support

#126
post #125

This page doesn't load for me (IE behind corp firewall). How does one drive/automate a headless browser? What kind of API is there?

Docs and a Youtube presentation...

https://chromium.googlesource.com/chromium/src/+/lkgr/headle...

https://www.youtube.com/watch?v=n6biclFh0i0&feature=youtu.be

Re: Chrome 59 has cross-platform headless support

#127
post #121

Related: I want to take screenshots of a few news websites for a little fake news project of mine, and most approaches return something completely different than what I'm seeing when I open Chrome. Limited height would be better/ok (something like the first 3000 pixels). Low volume / can be slow (30 seconds would be ok). Those news websites many times have infinite scrolling. I've tried: - phantomJS (rendering sucked…

Create a chrome extension for yourself that automates the process

Re: Chrome 59 has cross-platform headless support

#128
post #121

Related: I want to take screenshots of a few news websites for a little fake news project of mine, and most approaches return something completely different than what I'm seeing when I open Chrome. Limited height would be better/ok (something like the first 3000 pixels). Low volume / can be slow (30 seconds would be ok). Those news websites many times have infinite scrolling. I've tried: - phantomJS (rendering sucked…

I use xvfb for selenium testing. It is really easy to set up and can take screenshots or videos while automatically browsing websites.

Re: Chrome 59 has cross-platform headless support

#129
post #12

Also checkout https://github.com/cyrus-and/chrome-remote-interface for an easy way to fully control those headless instances

If you're using c#/dotnetcore https://github.com/BaristaLabs/chrome-dev-tools

Will generate a project file you can use in your own solution. Generated protocol is customizable via mustache templates too

Re: Chrome 59 has cross-platform headless support

#130

Earlier quoted context omitted.

We (Chrome) have reached out to PhantomJS to inquire if they're interested in collaborating: https://groups.google.com/d/msg/phantomjs-dev/S-mEBwuSgKQ/tU... The DevTools Protocol is the primary API for headless Chrome, but we are excited for higher-level abstractions like PhantomJS & NightmareJS's API to manipulate the browser as well. Plenty of details to work out, but hopefully sometime this year you'll get a drop-…

A few hours later: https://groups.google.com/forum/#!topic/phantomjs/9aI5d-LDuN...

After his announcement, Vitaly answered to the team: https://groups.google.com/d/msg/phantomjs-dev/S-mEBwuSgKQ/PQ...

> >Is there interest on your side in adopting Chromium as a runtime? There's some existing documentation [2] around the API and embedding, but admittedly, this would be some work.

> We are interested. But I am afraid not in the current state. Currently, PhantomJS heavily relies on Qt and QtWebKit. It's not that easy to adopt Chrome as a new runtime.

> But I think we could implement PhantomJS as a completely new (with the same API) project that will use Chrome - Phantomium!

Post reply on HN