HTML="" ""
<body>
The Dormouse 's story
Once upon a time there were three little sisters. And their names were .
,
And
;
And they lived at the bottom of a well. & lt;/p>
"" "
# z here USES BeautifulSoup library, declare a soup, parsing HTML
The from bs4 import BeautifulSoup
Soup=BeautifulSoup (HTML, 'LXML')
# here ready to extract The head tag in The HTML content, The return value of none, I'm meng, would you please tell me why The return none rather than, The Dormouse 's story
Print (soup. Head)
# and this soup. P only returned & lt; P>"
Print (soup) p)
CodePudding user response:
Soup=BeautifulSoup (html_doc, '. The HTML parser)
See the sample carefully
CodePudding user response: