GithubHelp home page GithubHelp logo

rajat069 / webscapper_thehindunews Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 16 KB

A simple Node.js web scraper using Axios, Cheerio, and Express to fetch and display the latest news headlines from "The Hindu" website.

JavaScript 100.00%
javascript news newsscraper nodejs webscraping

webscapper_thehindunews's Introduction

News Scraper

This project is a simple web scraper built using Node.js, Axios, Cheerio, and Express. It fetches and extracts the latest news headlines from "The Hindu" website and prints them to the console.

Prerequisites

Make sure you have Node.js installed on your machine. If you don't have it, you can download and install it from here.

Installation

  1. Clone the repository or download the project files.

  2. Navigate to the project directory and install the required dependencies using npm:npm install

Usage

  1. The scraper is set to fetch news from "The Hindu" website.

  2. To run the scraper, execute the following command in your terminal:npm start

  3. The server will start running on port 2003, and the scraped news headlines will be printed to the console.

Example Output

After running the scraper, the console will display an array of news objects with the following structure:

[ { "heading": "Some news headline", "link": "https://www.thehindu.com/some-news-link" }, ... ]

Notes

  1. The scraper filters out links that are less than 40 characters in length and ensures that they start with "https://www.thehindu.com".
  2. The server itself does not serve any web pages; it simply starts up to demonstrate that the code can run within an Express application context.

License

This project is licensed under the MIT License.

webscapper_thehindunews's People

Contributors

rajat069 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.