Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Scrapper for quotes.toscrape.com

Facundo Bautista Barbera edited this page Apr 4, 2023 · 5 revisions

QuotesToScrapeScrapper

This is the first implemented class to scrape quotes from quotes.toscrape.com.

Usage

Scrape

To scrape quotes from quotes.toscrape.com, you can use the QuotesToScrape class.

from scraping_library import QuotesToScrapeScrapper

# Scrape quotes.toscrape.com
scrapper = QuotesToScrape()
quotes = scrapper.scrape()

Each quote is a dictionary which is built like this:

quote = {
    "text": "The text of the quote",
    "author": "The author of the quote",
    "tags": ["a", "list", "of", "tags"]
}

Scrape Preloaded

An additional function allows for scrapping with known urls, which make the scrapping process much quicker by downloading all html files at the same time. The functionality is similar to the scrape function.

from scraping_library import QuotesToScrapeScrapper

# Scrape quotes.toscrape.com
scrapper = QuotesToScrape()
quotes = scrapper.scrape_preloaded()
Clone this wiki locally