Fix resulting TypeErrors.

master
PrismaticYT 2021-07-10 11:57:36 +12:00 committed by GitHub
parent 3b19807efa
commit 3a124381d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

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