Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LXML
#1
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
Reply
#2
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  lxml - etree/lxml need help storing variable for most inserted element goeb 0 2,564 Apr-01-2019, 03:09 AM
Last Post: goeb

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020