
In this activity, you will modify the sample code
Let's modify the sample code so that it pulls out the H3 tags rather than the H2 tags.
Make a copy of scrape1-simple.js
, calling it scrape1a-simple.js
.
Locate the section that selects the H2 tags:
// Search for the elements we want
selection = $('h2')
Change the code to select the H3 tags instead.
Run the code from the Terminal session in Visual Studio Code:
node scrape1a-simple.js
You should see data.csv change as follows:
country
Tirana
Yerevan
Vienna
Baku
Minsk
Brussels
Sarajevo
Sofia
Table of Contents