This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Scrapper for quotes.toscrape.com
Facundo Bautista Barbera edited this page Apr 4, 2023
·
5 revisions
This is the first implemented class to scrape quotes from quotes.toscrape.com.
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"]
}
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()