Skip to content

A NodeJS Scrapper That Will Return Stats and Information Based Upon Info Requested Using Cheerio.

License

Notifications You must be signed in to change notification settings

YaBoyWonder/Web-Scrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web-Scrapper

A NodeJS Web Scrapper That Will Return Real-Time Information Based Upon Info Requested


First Things First

  1. In your Project Folder run npm init -y or run npm init and put whatever you want in the requirements

  2. Run npm i cheerio and npm i request unless they are already installed


I am providing the following things.
  • a Default file to use

  • one Formated to Retrieve the Daily Pokemon + Episode Titles from the Pokemon Website a sample pretty much on how simple this is to use aswell

Output


Default Code.

const request = require('request');
const cheerio = require('cheerio');

request('WEBSITE_URL_GOES_HERE', (error, Response, html) => {

        if (!error) {

                const $ = cheerio.load(html)
                
                
                const HTML_TITLE_NAME = $('HTML_CLASS_WHICH_YOU_WANT_INFO_FROM');

                console.log(HTML_TITLE_NAME)

        }

})



Note

There is going to be whitespace in the console, in my opinion it was never a problem but seeing that it may be for others, you can simply just add this replace method in

replace(/\s\s+/g, '');

About

A NodeJS Scrapper That Will Return Stats and Information Based Upon Info Requested Using Cheerio.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published