Jun-08-2020, 04:20 PM
Hi
I'am a little disappointed with beautifulSoup handling a tree.
Apparently, using another parser than html5lib does not make any difference.
So, how could I get <html></html> as a child of soup ?
Arbiel
I'am a little disappointed with beautifulSoup handling a tree.
>>> from bs4 import BeautifulSoup as btfs >>> soup=btfs('', 'html5lib') >>> soup <html><head></head><body></body></html> >>> for elem in soup.children: ... print(elem) ... <html><head></head><body></body></html> >>>I would expect, in the preceding example, soup to have as single child <html></html> rather than <html><head></head><body></body></html>.
Apparently, using another parser than html5lib does not make any difference.
So, how could I get <html></html> as a child of soup ?
Arbiel
using Ubuntu 18.04.4 LTS, Python 3.8
having substituted «https://www.lilo.org/fr/» to google, «https://protonmail.com/» to any other unsafe mail service and bépo to azerty (french keyboard layouts)
having substituted «https://www.lilo.org/fr/» to google, «https://protonmail.com/» to any other unsafe mail service and bépo to azerty (french keyboard layouts)