Warning raised when using lxml.html.soupparser.fromstring
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Triaged
|
Undecided
|
Unassigned |
Bug Description
There's a warning raised when using lxml.html.
In [1]: from lxml.html.
In [2]: s = """<!DOCTYPE html>
...: <html>
...: <head>
...: <title>Hi!</title>
...: </head>
...: <body>
...: Foobar
...: </body>
...: </html>"""
In [3]:
In [3]: fromstring(s)
/Users/
The code that caused this warning is on line 11 of the file /Users/
BeautifulSoup(
to this:
BeautifulSoup(
markup_
I happen to know that the same warning is raised when using the BeautifulSoup library like so:
In [5]: from bs4 import BeautifulSoup
In [5]: from bs4 import BeautifulSoup
In [6]: s = """<!DOCTYPE html>
...: <html>
...: <head>
...: <title>Hej</title>
...: </head>
...: <body>
...: Foobar
...: </body>
...: </html>"""
In [7]: BeautifulSoup(s)
/Users/
The code that caused this warning is on line 11 of the file /Users/
BeautifulSoup(
to this:
BeautifulSoup(
markup_
Out[7]:
<!DOCTYPE html>
<html>
<head>
<title>Hej</title>
</head>
<body>
Foobar
</body>
</html>
In [8]: BeautifulSoup(s, 'lxml') # no warning raised
Out[8]:
<!DOCTYPE html>
<html>
<head>
<title>Hej</title>
</head>
<body>
Foobar
</body>
</html>
System information:
Python : sys.version_
lxml.etree : (3, 8, 0, 0)
libxml used : (2, 9, 4)
libxml compiled : (2, 9, 4)
libxslt used : (1, 1, 29)
libxslt compiled : (1, 1, 29)
PR welcome.