diff --git a/cookbook/helper/scrapers/scrapers.py b/cookbook/helper/scrapers/scrapers.py index 5f9f939f..98807d18 100644 --- a/cookbook/helper/scrapers/scrapers.py +++ b/cookbook/helper/scrapers/scrapers.py @@ -1,6 +1,6 @@ from bs4 import BeautifulSoup from json import JSONDecodeError -from recipe_scrapers import SCRAPERS, get_domain, _exception_handling +from recipe_scrapers import SCRAPERS, get_host_name from recipe_scrapers._factory import SchemaScraperFactory from recipe_scrapers._schemaorg import SchemaOrg @@ -17,7 +17,7 @@ SCRAPERS.update(CUSTOM_SCRAPERS) def text_scraper(text, url=None): domain = None if url: - domain = get_domain(url) + domain = get_host_name(url) if domain in SCRAPERS: scraper_class = SCRAPERS[domain] else: @@ -25,12 +25,12 @@ def text_scraper(text, url=None): class TextScraper(scraper_class): def __init__( - self, - page_data, - url=None + self, + page_data, + url=None ): self.wild_mode = False - self.exception_handling = _exception_handling + self.exception_handling = None # TODO add new method here, old one was deprecated self.meta_http_equiv = False self.soup = BeautifulSoup(page_data, "html.parser") self.url = url