mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-07 07:08:03 -05:00
reverting scraper to just using wildmode
This commit is contained in:
@@ -6,7 +6,7 @@ from urllib.parse import unquote
|
|||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from bs4.element import Tag
|
from bs4.element import Tag
|
||||||
from recipe_scrapers import scrape_html, scrape_me
|
from recipe_scrapers import scrape_html, scrape_me
|
||||||
from recipe_scrapers._exceptions import NoSchemaFoundInWildMode, WebsiteNotImplementedError
|
from recipe_scrapers._exceptions import NoSchemaFoundInWildMode
|
||||||
from recipe_scrapers._utils import get_host_name, normalize_string
|
from recipe_scrapers._utils import get_host_name, normalize_string
|
||||||
|
|
||||||
from cookbook.helper import recipe_url_import as helper
|
from cookbook.helper import recipe_url_import as helper
|
||||||
@@ -70,12 +70,9 @@ def get_recipe_from_source(text, url, request):
|
|||||||
|
|
||||||
if url and not text:
|
if url and not text:
|
||||||
try:
|
try:
|
||||||
scrape = scrape_me(url_path=url)
|
scrape = scrape_me(url_path=url, wild_mode=True)
|
||||||
except WebsiteNotImplementedError:
|
except(NoSchemaFoundInWildMode):
|
||||||
try:
|
pass
|
||||||
scrape = scrape_me(url_path=url, wild_mode=True)
|
|
||||||
except(NoSchemaFoundInWildMode):
|
|
||||||
pass
|
|
||||||
if not scrape:
|
if not scrape:
|
||||||
try:
|
try:
|
||||||
parse_list.append(remove_graph(json.loads(text)))
|
parse_list.append(remove_graph(json.loads(text)))
|
||||||
|
|||||||
Reference in New Issue
Block a user