Nachdem ich BeautifulSoup installiert habe, erscheint diese Warnung immer, wenn ich mein Python in cmd starte.Wie BeautifulSoup Benutzer Warnung loswerden?
D:\Application\python\lib\site-packages\beautifulsoup4-4.4.1-py3.4.egg\bs4\__init__.py:166:
UserWarning: No parser was explicitly specified, so I'm using the best
available HTML parser for this system ("html.parser"). This usually isn't a
problem, but if you run this code on another system, or in a different
virtual environment, it may use a different parser and behave differently.
To get rid of this warning, change this:
BeautifulSoup([your markup])
to this:
BeautifulSoup([your markup], "html.parser")
Ich habe kein Ideal, warum es herauskommt und wie man es löst.
Die Nachricht, die Sie genau das, was sagt zu tun: 'BeautifulSoup ([Markup] "html.parser")'. Hast du das gemacht und gesehen, was dein Output ist? BeautifulSoup versucht, dir das Leben zu erleichtern. Höre auf die Suppe. :) – idjaw
Ändern Sie Ihren Code wie 'supp = BeautifulSoup (html)' in 'supp = BeautifulSoup (html," html.parser ")'. –
Danke euch allen! : D – jellyfishhuang