Hacker News new | ask | show | jobs
by domenicd 2068 days ago
The article didn't touch on this very well, but the reason to upgrade from cheerio to jsdom is if you want to run scripts. E.g., for client-rendered apps, or apps that pull their data from XHR. Since jsdom implements the script element, and the XHR API, and a bunch of other APIs that pages might use, it can get a lot further in the page lifecycle than just "parse the bytes from the server into an initial DOM tree".

(I'm a maintainer of jsdom.)

1 comments

Running the [arbitrary] scripts not written by me is what I usually try to avoid and fear when scraping.