This is a bug in lxml. You can work around it by parsing the markup using html.parser or html5lib parser instead of lxml.
This is a bug in lxml. You can work around it by parsing the markup using html.parser or html5lib parser instead of lxml.