JSDOM in cloudflare worker?

Background
I would like to use the Cloudflare worker to get information from a single page application. I need the application to render javascript before can get this information.

Has anyone successfully managed to use a headless browser such as JSDOM in a Cloudflare worker?
Is this something thats even possible at this time? Are there any examples out there?

Parsing the DOM require too much CPU time.

See the benchmarks, they go over the 5ms of the free plan - you’d have to use a larger plan that gives you 20ms to be able to do this.

1 Like

Oh wow…Thanks for bringing that up. It appears that Cloudflare worker will not work for my use case.

Afaik, there is no complete DOM replacement, but you may try my adopted version of node-trumpet:

1 Like

cheerio works in my experience

https://github.com/cheeriojs/cheerio