Python: object of type 'Response' has no len() -


issue: when try execute script, receive error message "typeerror: object of type 'response' has no len(). tried passing actual html parameter, still doesn't work.

import requests  url = 'http://vineoftheday.com/?order_by=rating' response = requests.get(url) html = response.content  soup = beautifulsoup(html, "html.parser") 

you getting response.content. return response body bytes (docs). should pass str beautifulsoup constructor (docs). need use response.text instead of getting content.


Comments

Popular posts from this blog

c++ - list<myClass<int> * > sort -

SoapUI on windows 10 - high DPI/4K scaling issue -

java - why am i getting a "cannot resolve method" error on getApplication? -