Issue: when I try to execute the script, BeautifulSoup(html, ...)
gives the error message "TypeError: object of type 'Response' has no len(). I tried passing the actual html as a parameter, but it still doesn't work.
url = "https://www.ximalaya.com/shangye/6855034/"
headers={
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0',
}
html=requests.get(url,headers=headers)
html.encoding = 'utf-8'
# print(html.text)
soup = BeautifulSoup(html.text, 'html.parser')
# soup = BeautifulSoup(html, 'html.parser'),传入参数html不行哦
print(soup.text)
https://stackoverflow.com/questions/36709165/beautifulsoup-object-of-type-response-has-no-len