Settings

Theme

Ask HN: What are you using headless Chrome for?

17 points by cptnntsoobv · 22 comments · 1 min read


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.

8 threads
enlightens

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

I used it for creating PDFs at my last job.

  • digianarchist

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

  • kypro

    Could someone elaborate? How does this work?

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

    • eberkund

      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

    I use currently use puppeteer to do the same thing

jjeaff

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

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

  • jamil7

    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

      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

    *scrape

mothinx

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

  • joefarish

    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

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

pkz

I use it to archive complex web pages.

r0s

Automated testing.

Keyboard Shortcuts

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