Part one: Web Scraping in Node JS Step By Step

Puppeteer

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(`https://www.jumia.co.ke/catalog/?q=${encodeURI(searchTerm)}`);
Figure 4: Output to console

--

--

--

learn, innovate repeat. Writer, web developer ,tech & nature enthusiast. My posts are abstract😜

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

ORE Token will soon be listed on UNISWAP!

Avoiding mutation with Shallow Copy

Deciding which React Component to use

The Power of Acceptance

How to deal with asynchronous code in JavaScript

TypeScript vs JavaScript

Key Differences between NextJS and NextJS + React | Copperchips

Recharts: How To show/hide axis

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
Charlie K

Charlie K

learn, innovate repeat. Writer, web developer ,tech & nature enthusiast. My posts are abstract😜

More from Medium

M_STORE — An e-commerce site for my ALX/Holberton portfolio project

Lessons Learned Series : 12 Year Journey turning side projects to side income — essay series 2 of 6

Here comes the first post

How to convert your Text into AudioBook using JavaScript