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

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

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