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

Going back to single utils file and using the new types file

Karim shoair6eeca3daa706
diff --git a/scrapling/utils/__init__.py b/scrapling/utils.py
similarity index 98%
rename from scrapling/utils/__init__.py
rename to scrapling/utils.py
index 3defaf4..5f8efc9 100644
--- a/scrapling/utils/__init__.py
+++ b/scrapling/utils.py
@@ -4,9 +4,10 @@ from itertools import chain
# Using cache on top of a class is brilliant way to achieve Singleton design pattern without much code
from functools import lru_cache as cache # functools.cache is available on Python 3.9+ only so let's keep lru_cache
-from typing import Dict, Iterable, Any
+from scrapling._types import Dict, Iterable, Any
from lxml import html
+
html_forbidden = {html.HtmlComment, }
logging.basicConfig(
level=logging.ERROR,