Skip to content

Commit

Permalink
Bring back the scrape_me method
Browse files Browse the repository at this point in the history
  • Loading branch information
hhursev committed Feb 22, 2025
1 parent 0dcc85d commit 633ea40
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions recipe_scrapers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

import warnings

from urllib.request import urlopen

try:
# requests is an optional dependency; we can provide better error messages
# when we know that it's unavailable before a user attempts a web request
Expand Down Expand Up @@ -1020,3 +1022,8 @@ def scrape_html(
return schema_scraper

raise NoSchemaFoundInWildMode(org_url)


def scrape_me(url: str) -> AbstractScraper:
html = urlopen(url).read().decode("utf-8")
return scrape_html(html, org_url=url)

0 comments on commit 633ea40

Please sign in to comment.