I've done more web scraping with Python, mostly using the Beautiful Soup library combined with AI tools. In JavaScript, I've only used an open source tool Puppeteer. It's been good enough for my simple use cases, but for advanced and large-scale use cases you can combine it with other tools for proxy rotation, CAPTCHA solving, etc. so that websites don't block your IP address.
Puppeteer has an API.