The lxml html5parser seems to ignore any namespaceHTMLElements=False
option I pass to it. It puts all elements I give it into the HTML namespace instead of the
I have followed in the source-code, how lxml hands params to html5lib. Most of the functions have a finishing *kws, which is then handed to the next function. In one of the last steps when calling the actual html5 parser, this is dropped and the parser is called with 2 fixed params.
(I had the same problem yesterday, and just got to this question, and forgot the tiny details, allow me to forgo any code-snippets, and references.)
Anyway, this confirms that in 2018, calling the html5lib directly with is still the preferred way, if calling lxml's own parser is not an option for some reason.
(My use-case was: parse crappy html and have xpath.)