Skip to content

Instantly share code, notes, and snippets.

View r-shafi's full-sized avatar

Shafi r-shafi

View GitHub Profile
@r-shafi
r-shafi / scraper.js
Created December 28, 2022 06:01
A working modal data scraper. This uses Puppeteer to scrape user data from a forum. Error handling included.
const puppeteer = require('puppeteer');
async function scrape() {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto('https://forum.freecodecamp.org/');
const avatars = await page.$$('.topic-poster img.avatar');