Retrieves all titles from Iggy Pop's current playlists on the BBC. Based on Bello Gbadebo's tutorial How To Scrape a Website Using Node.js and Puppeteer .
Node 12+
npm i
Create file .env containing:
FILEPATH="<PATH_TO_SAVE_YOUR_SCRAPED_TRACKLISTS>"
SCRAPE_URL="https://www.bbc.co.uk/sounds/brand/b03yblbx"
Create file .config.js containing:
require("dotenv").config({ path : "<PATH_TO_YOUR_.ENV_FILE>", debug : process.env.DEBUG });
module.exports = { FILEPATH: process.env.FILEPATH, SCRAPE_URL: process.env.SCRAPE_URL };
In case you're running this on Ubuntu and the puppeteer brower doesn't launch, this might help:
$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$ sudo apt install ./google-chrome-stable_current_amd64.deb
Thanks to Codegrepper.com .