Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Soup hyphen in comment #251
<html> <body> <div> Test </div> <!-- This is -- a comment with double hyphen --> </body> </html>
When parsing with soupparser, exception raised
The lxml code that raise the exception is in
hmm... It seems lxml.html can parse comment with 2 hyphens with no problem.
from lxml.html import soupparser from lxml import html content = "<html><!-- something with -- 2 hyphen --></html>" tree = html.fromstring(content) print(html.tostring(tree)) tree = soupparser.fromstring(content) print(html.tostring(tree))