Settings

Theme

Ask HN: What are you using headless Chrome for?

17 points by cptnntsoobv 5 years ago · 22 comments · 1 min read

Reader

The headless version of chrome has seen great adoption since it was launched 4-5 years ago. I am wondering what types of use cases it is being used for.

Running automated tests is one the most common use cases I am familiar with. Are there any other purposes folks are using it for?

I am also curious about large scale cloud deployments use cases for headless chrome that the HN crowd might be aware of.

enlightens 5 years ago

Generating diagrams from Markdown files using the Mermaid JS library. They have a CLI but it's NPM based so you basically have to pick your poison as to what you'll be configuring. In my case Chrome made more sense.

eberkund 5 years ago

I used it for creating PDFs at my last job.

  • digianarchist 5 years ago

    We've done this. You can run it in AWS lambda.

  • kypro 5 years ago

    Could someone elaborate? How does this work?

    Do you create a HTML document then print the output as a PDF with headless Chrome?

    • eberkund 5 years ago

      Yes exactly, HTML document using whatever templating language you want (or even client-side JavaScript framework since Chrome can handle that too) and then output a PDF.

  • cjfont 5 years ago

    I use currently use puppeteer to do the same thing

jjeaff 5 years ago

I use it to interface and download reports and other data on behalf of customers from sites that don't have any type of 3rd party api.

jmnicolas 5 years ago

I use it to get rendered web pages I want to scrap.

  • jamil7 5 years ago

    I was doing the same for an article reader / archiver I built but it was slow. Did you ever figure out how to speed it up? Cancelling image and media requests helped but it increased the likelihood of being flagged as a bot.

    • jmnicolas 5 years ago

      Sorry I never looked at the perf aspect of it since my needs were modest (less than 50 web pages per day). The first thing that would come to my mind is to parallelize it but then it's going to become pretty complex.

  • matt_f 5 years ago

    *scrape

mothinx 5 years ago

I use it for a trading bot on Fifa 2020 Fut mode

  • joefarish 5 years ago

    I imagine you don't want to share too much info about this, but I'd be interested in any more detail you are willing to share.

jamieweb 5 years ago

I use it to test my Content-Security-Policy by crawling my whole site and capturing any violation reports that are sent.

pkz 5 years ago

I use it to archive complex web pages.

r0s 5 years ago

Automated testing.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection