Page 1 of 1

Warnung, wie kann man es deaktivieren? "XmlparsedashtmlWarning: Es sieht so aus, als würden Sie ein XML -Dokument mit ei

Posted: 28 Feb 2025, 10:17
by Anonymous
Volltext: < /p>

Code: Select all

/usr/lib/python3.12/html/parser.py:171: XMLParsedAsHTMLWarning:
It looks like you're parsing an XML document using an HTML parser.
If this really is an HTML document (maybe it's XHTML?), you can ignore or filter
this warning. If it's XML, you should know that using an XML parser will be more
reliable. To parse this document as XML, make sure you have the lxml package
installed, and pass the keyword argument `features="xml"` into the BeautifulSoup
constructor.
< /code>
Ich analyse html.from bs4.builder import XMLParsedAsHTMLWarning
import warnings
warnings.filterwarnings("ignore", category=XMLParsedAsHTMLWarning)
< /code>
Initialisierungszeile: < /p>
soup = BeautifulSoup(meta["content"], "html.parser")