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
Post a Comment