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

Give response's body bytes priority over response's text

Karim shoair1ff1c93bcf2d
diff --git a/scrapling/engines/toolbelt/custom.py b/scrapling/engines/toolbelt/custom.py
index 990244e..3d71b4f 100644
--- a/scrapling/engines/toolbelt/custom.py
+++ b/scrapling/engines/toolbelt/custom.py
@@ -24,10 +24,10 @@ class Response:
@property
def adaptor(self):
- if self.text:
- return Adaptor(text=self.text, url=self.url, encoding=self.encoding, **self.adaptor_arguments)
- elif self.content:
+ if self.content:
return Adaptor(body=self.content, url=self.url, encoding=self.encoding, **self.adaptor_arguments)
+ elif self.text:
+ return Adaptor(text=self.text, url=self.url, encoding=self.encoding, **self.adaptor_arguments)
return None
def __repr__(self):