Merge pull request #701 from RPMYT/master

Fix 'CachedResponse has no len()' error
master
Arjix 2021-07-21 13:37:28 +03:00 committed by GitHub
commit 166013d0eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -146,9 +146,10 @@ def soupify(res):
------- -------
BeautifulSoup.Soup BeautifulSoup.Soup
""" """
if isinstance(res, requests.Response): if isinstance(res, str):
res = res.text soup = BeautifulSoup(res, 'html.parser')
soup = BeautifulSoup(res, 'html.parser') else:
soup = BeautifulSoup(res.text, 'html.parser')
return soup return soup