Part one: Web Scraping in Node JS Step By Step


What is web scraping and how can it be of use?

npm i puppeteer

Let’s scrape!

Figure 1: Website to be scraped
Figure 2: Page elements
Figure 3: Element attributes
const puppeteer = require('puppeteer');const browser = await puppeteer.launch({    headless: false,    defaultViewport: null});const page = await browser.newPage();await page.goto(`${encodeURI(searchTerm)}`);
Figure 4: Output to console



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store