Search⌘ K

Challenge: Puppeteer Fundamentals

Explore Puppeteer fundamentals by completing hands-on tasks that involve scraping data using ID, class, attribute, and nested selectors. Understand how to extract specific web page elements and manipulate values like price rounding to build your web scraping skills effectively.

In this challenge, we’ll use our knowledge of Puppeteer selectors to complete the below tasks.

Task 1: Scrape book title with ID selector

We must extract the book title (A Light in the Attic) with an ID selector from the HTML page below. Your task is to implement this in Puppeteer using an ID selector.

 Write your code in the following snippet.

{
  "name": "puppeteer-learn",
  "version": "1.0.0",
  "description": "",
  "type": "commonjs",
  "main": "index.js",
  "scripts": {
    "start": "node index.js"
  },
  "keywords": [],
  "author": "",
  "license": "MIT",
  "dependencies": {
    "puppeteer": "19.8.3"
  }
}
Challenge to extract data with id selector

If you’re unsure how to do ...