Giter VIP home page Giter VIP logo

cnn-scraper's Introduction

CNN Website Scraper

This repository contains a Python script that uses the Scrapy framework to scrape news headlines, timestamps, and related images from the CNN website. A demonstration video has also been added to the repository to easily understand the working.

Table of Contents

Installation

  1. Clone this repository to your local machine using the following command:
git clone https://github.com/prathamgarg911/CNN-scraper.git
  1. Install the required dependencies using pip:
pip install -r requirements.txt

Usage

  1. Navigate to the project directory:
cd web_cnn
  1. Run the Scrapy spider:
scrapy crawl web_scrape_cnn -O scraped_data.json

This will start the scraping process and save the data to an scraped_data.json file and the images to a folder named scraped-images.

Output

The scraper will generate a JSON file (scraped_data.json) with the following structure:

[
  {
    "headline": "Sample Headline",
    "timestamp": "Day Month Date, Year",
    "image_link": "https://example.com/image.jpg",
    "local_image": "web_cnn/scraped-images/image1.jpg"
  }
]

You can also generate a CSV file (scraped_data.csv) with a similar structure.

Contributing

If you'd like to contribute to this project, feel free to fork the repository and submit a pull request. Make sure to follow the Contributing Guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.


cnn-scraper's People

Contributors

prathamgarg911 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.