lxml.html パッケージの html5parser を使用する場合、タグの名前空間を追加しないことはできますか?
例:
from lxml import html
print(html.parse('http://example.com').getroot().tag)
# You will get 'html'
from lxml.html import html5parser
print(html5parser.parse('http://example.com').getroot().tag)
# You will get '{http://www.w3.org/1999/xhtml}html'
私が見つけた最も簡単な解決策は、正規表現を使用してそれを削除することですが、そのテキストをまったく含めないようにすることは可能でしょうか?