You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
670 B
22 lines
670 B
# ============================================================
|
|
# File: scraper/book_scraper.py
|
|
# Purpose:
|
|
# Backwards-compatible wrapper giving same API as before.
|
|
# Uses the new engine under the hood.
|
|
# ============================================================
|
|
|
|
from scraper.engine.parser import extract_metadata_full
|
|
|
|
|
|
class BookScraper:
|
|
def __init__(self, site_scraper, url):
|
|
self.site = site_scraper
|
|
self.url = url
|
|
|
|
def execute(self):
|
|
"""
|
|
Backwards compatible full scrape:
|
|
returns {title, author, description, cover_url, chapters, book_url}
|
|
"""
|
|
return extract_metadata_full(self.url, self.site)
|