Python Forum
LXML - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: LXML (/thread-21578.html)



LXML - mustfirst - Oct-05-2019

I installed BeautifulSoup and LXML. I'm running python in Windows CMD.

When I run the following I get an error. Anyone know what is going on and how to fix it?

>>> import lxml.html
>>> import lxml.etree
>>>
>>> html = requests.get("https://store.steampowered.com/explore/new/")
>>> doc = lmxl.html.fromstring(html.content)
Error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'lmxl' is not defined



RE: LXML - buran - Oct-05-2019

it's a typo, you have lmxl instead of 'lxml

As a side note, I find it easier to use BeautifulSoup instead of lxml directly