Challenge 2: Split on Multiple Pages
Goal
Each page has a few persons. Create an agent and find a way to scrape every pages.
Documentation
Instructions
  1. Create the agent scraping-challenge-2
  2. Access this page using Puppeteer.newPage() and Puppeteer.Page.goto() to open the page.
  3. Wait for an element to load before scraping with Puppeteer.Page.waitForSelector().
  4. Use the function Puppeteer.Page.addScriptTag() to inject jQuery in the page.
  5. Create a function to scrape the page with jQuery now that it is injected and execute it in the page using Puppeteer.Page.evaluate().
  6. Use the url pagination and a for loop and repeat the scraping.
  7. Send the data using buster.setResultObject().
Solution

Persons 0 - 2 / 100

Name
Mr Aaron Willer
Birth year
Death year
1912
Gender
M
Marital status
Spouse
Ticket class
3
Ticket number
3410
Ticket price
8.14
Residence
Job
Companions count
0
Cabin
Embarked in
Cherbourg
Destination
Chicago Illinois United States
Died in the Titanic
Yes
Body recovered
No
Rescue boat number
Name
Mr Albert Augustsson
Birth year
1889
Death year
1912
Gender
M
Marital status
Spouse
Ticket class
3
Ticket number
347468
Ticket price
7.17
Residence
Krakoryd Småland Sweden
Job
General Labourer
Companions count
0
Cabin
Embarked in
Southampton
Destination
Bloomington Indiana United States
Died in the Titanic
Yes
Body recovered
No
Rescue boat number