Skip to content
Snippets Groups Projects
Commit d1acc0a1 authored by Fjen Undso's avatar Fjen Undso
Browse files

handle html parsing error

parent 0971a492
Branches master
No related tags found
No related merge requests found
......@@ -185,8 +185,9 @@ def get_html(url: str, search: str) -> str:
r.raise_for_status()
except RequestException:
logger.exception("Mydealz content fetch failed:")
return ""
return r.html.find(search, first=True).html
return "content fetch failed"
content = r.html.find(search, first=True)
return content.html if content else "no content"
@app.route("/mydealz/<int:score>")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment