Search code examples
javascripttestingweb-scrapingtestcafedata-extraction

Scraping Data using JavaScript


I am working on a project where I want to scrape out data from a website whenever the value of the range slider is changed by the user and compare it with the actual data.

The tasks are:

  1. Scrape the actual data(initial value) 2.Scrape out the base data(the value changed by the user)
  2. I am supposed to extract the base data for each change in value done by the user and compare it with the actual data and store it in local directory (CONDITION: Must be done only using JavaScript)

The slider is present within an iframe.

Can someone please suggest any approach/packages for doing this?


Solution

  • There are different ways to do scraping in javascript:

    • Regular Expressions: The hard way
    • Cheerio: Core JQuery for traversing the DOM
    • JSDOM: The DOM for Node
    • Puppeteer: The headless browser
    • Nightmare: An alternative to Puppeteer

    For more info, try this article: https://www.scrapingbee.com/blog/web-scraping-javascript/