How to Solve NameError: name 'etree' is not defined -- lxml

Solution: Import the 'etree' module

To Solve the error, add the following line to the top of your code.

from lxml import etree

 

For more information:
Python lxml etree