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
Bonus
Try doing it without tab.click(). (for of + url pagination)
Instructions
  1. Create the agent scraping-challenge-2
  2. Access this page using tab.open() to open the page.
  3. Wait for an element to load before scraping with tab.waitUntilVisible().
  4. Use the function tab.inject() 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 tab.evaluate().
  6. Use tab.click() on the next button or use the url pagination and a for loop and repeat the scraping.
  7. Send the data using buster.setResultObject().
Solution

Persons 2 - 4 / 100

Name
Mr Albert White
Birth year
Death year
1912
Gender
M
Marital status
Spouse
Member of crew
Yes
Last ship (crew)
Residence
Southampton Hampshire England
Job
Trimmer
Companions count
0
Cabin
Embarked in
Southampton
Destination
Died in the Titanic
Yes
Body recovered
No
Rescue boat number
Name
Mr Albert Wirz
Birth year
1894
Death year
1913
Gender
M
Marital status
Spouse
Ticket class
3
Ticket number
315154
Ticket price
8.13
Residence
Uster Switzerland
Job
Farmer
Companions count
0
Cabin
Embarked in
Southampton
Destination
Beloit Wisconsin United States
Died in the Titanic
Yes
Body recovered
Yes
Rescue boat number