A web scraper created using Puppeteer library on the backend to scrape the stock market prediction data off of CNBC's premarket page.
- Node.js
- NPM
- Clone the repository at https://github.com/ewliang/CNBC-Premarket-Web-Scraper
- Unzip the file if needed.
- Run
npm install
in the folder root directory where package.json is located - Run
npm run dev
to start. - Begin scrape by typing into your browser
localhost:4000/scrape
and the scraping process will begin. No page will load, so disregard any browser error messages that show up. The scraped data will show up in the console window via console.log().
Why is Puppeteer used instead of Cheerio?
- Despite the performance benefits gained from using Cheerio, Cheerio was not used due to its lack of proper support for client side rendered pages built on SPAs like React.js, which in this case the CNBC site is built off of.
Eric Liang
- Website https://www.eric-liang.com
- Github https://www.github.com/ewliang
This program is protected by the GPLv3 license.