Skip to content

Commit

Permalink
Give response's body bytes priority over response's text
Browse files Browse the repository at this point in the history
  • Loading branch information
D4Vinci committed Nov 3, 2024
1 parent afe5333 commit 1ff1c93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scrapling/engines/toolbelt/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 1ff1c93

Please sign in to comment.