Skip to content

Python scraper based on AI

Merge branch 'pre/beta' into supercoder-327

Marco Vinciguerra5065aa00e1a4
diff --cc scrapegraphai/utils/cleanup_html.py
index ea008fc5,1774af20..d3b4dd48
--- a/scrapegraphai/utils/cleanup_html.py
+++ b/scrapegraphai/utils/cleanup_html.py
@@@ -63,9 -53,9 +59,9 @@@ def cleanup_html(html_content: str, bas
if body_content:
# Minify the HTML within the body tag
minimized_body = minify(str(body_content))
-
return title, minimized_body, link_urls, image_urls
- # return "Title: " + title + ", Body: " + minimized_body + ", Links: " + str(link_urls) + ", Images: " + str(image_urls)
- # Add fallback mechanism
- # throw an error if no body content is found
- raise ValueError("No HTML body content found, please try setting the 'headless' flag to False in the graph configuration.")
+ else:
+ logging.error(f'No body content found in HTML: {html_content}')
+ raise ValueError(f"No HTML body content found, please try setting the 'headless' flag to False in the graph configuration. HTML content: {html_content}")
++