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

Small fix for the `ResponseEncoding` class

Karim shoair06a47f9644c5
diff --git a/scrapling/engines/toolbelt/custom.py b/scrapling/engines/toolbelt/custom.py
index 0cdc65e..2c7cd94 100644
--- a/scrapling/engines/toolbelt/custom.py
+++ b/scrapling/engines/toolbelt/custom.py
@@ -65,10 +65,10 @@ class ResponseEncoding:
encoding = params["charset"].strip("'\"")
# Apply content-type specific rules
- if content_type in cls.__ISO_8859_1_CONTENT_TYPES:
+ elif content_type in cls.__ISO_8859_1_CONTENT_TYPES:
encoding = "ISO-8859-1"
- if content_type == "application/json":
+ elif content_type == "application/json":
encoding = cls.__DEFAULT_ENCODING
if encoding: