Skip to content

🕷️ 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

fix: remove no-op strip_cdata kwarg from lxml HTMLParser to silence DeprecationWarning (#493)

Suyadi609f519e6b45
diff --git a/scrapling/parser.py b/scrapling/parser.py
index abe77e2..00c7c19 100644
--- a/scrapling/parser.py
+++ b/scrapling/parser.py
@@ -160,7 +160,6 @@ class Selector(SelectorsGeneration):
compact=True,
huge_tree=huge_tree,
default_doctype=True, # Supported by lxml but missing from stubs
- strip_cdata=(not keep_cdata),
)
parser = HTMLParser(**_parser_kwargs)
self._root = cast(HtmlElement, fromstring(body or "<html/>", parser=parser, base_url=url or ""))