python – I am getting the error Response object has no attribute fromstring

python – I am getting the error Response object has no attribute fromstring

Dont nest functions like this. Un-nest your function and it will work fine.

You define html = requests.get(*)

What this returns is a response object.

In your nested function youre using this html instead of what you imported from lxml import html because of the namespace(s).

python – I am getting the error Response object has no attribute fromstring

Leave a Reply

Your email address will not be published. Required fields are marked *