🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Python aiai-scrapingautomationcrawlercrawlingcrawling-pythondatadata-extractionmcpmcp-serverplaywrightpythonscrapingselectorsstealthweb-scraperweb-scrapingweb-scraping-pythonwebscrapingxpath
fix(parser): handle responses with empty body
Karim shoairdac854a12930
diff --git a/scrapling/parser.py b/scrapling/parser.pyindex f7da3a9..8e9704d 100644--- a/scrapling/parser.py+++ b/scrapling/parser.py@@ -138,7 +138,7 @@ class Selector(SelectorsGeneration):default_doctype=True,strip_cdata=(not keep_cdata),)- self._root = cast(HtmlElement, fromstring(body, parser=parser, base_url=url or None))+ self._root = cast(HtmlElement, fromstring(body or "<html/>", parser=parser, base_url=url or None))self._raw_body = contentelse: