Hacker News new | ask | show | jobs
by Axsuul 4191 days ago
What's the benefit of injecting JavaScript into the page when it comes to scraping?
1 comments

You gain access to the page's own DOM and JavaScript, which lets you call the site's functions to fetch data if it helps you. You can also code your scraper with the same techniques you use when building a page: jQuery, CSS selectors, etc - basically all the good interfaces that have been developed over the past 20 years are available to your scraping code.