Giter VIP home page Giter VIP logo

quote-scraper's Introduction

Quotes Scraper

This script scrapes famous quotes from the website quotes.toscrape.com and saves them to a JSON file for offline usage.

Features

  • Scrapes quotes and their authors from the first three pages of the website.
  • Stores the scraped data in a structured JSON format.
  • Uses politeness policy by waiting 2 seconds between requests to not overload the server.

Technologies Used

  • Python: The script is written in Python.
  • Requests: A simple HTTP library for Python used to make requests to the website.
  • BeautifulSoup: A library for pulling data out of HTML and XML files, used for web scraping tasks.
  • JSON: Used for storing the scraped data in a structured format for later usage.

How to Use

  1. Make sure you have Python installed on your machine.

  2. Install the required Python libraries:

    pip install requests beautifulsoup4
  3. Run the script:

    python main.py
  4. After the script has run, you'll find a quotes.json file in the same directory. This file contains the scraped quotes.

Important Notes

  • This script is intended for educational purposes. Before scraping any website, always refer to the website's robots.txt file and terms of service to ensure you're allowed to scrape it.
  • Avoid making rapid, consecutive requests to websites. Always implement delays and respect the website's rate limits.

License

This project is open-sourced under the MIT License.

quote-scraper's People

Contributors

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