CodePudding
  • Home
  • front end
  • Back-end
  • Net
  • Software design
  • Enterprise
  • Blockchain
  • Mobile
  • Software engineering
  • database
  • OS
  • other
Home > other >  Today, I again come, learn BeautifulSoup encounter a problem, soup. The head returns a value of none
Today, I again come, learn BeautifulSoup encounter a problem, soup. The head returns a value of none

Time:09-28

# variable declaration HTML
HTML="" ""
The Dormouse 's story
<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>"

, not science, why ah,
Print (soup) p)

CodePudding user response:

 
Soup=BeautifulSoup (html_doc, '. The HTML parser)


See the sample carefully

CodePudding user response:

reference 1st floor nieoding response:
 
Soup=BeautifulSoup (html_doc, '. The HTML parser)


See example careful

Use HTML. LXML, zhe right here, just HTML text inside out a more ", result in output have a lot of discrepancy, thank you,
Done on my own

Page link:https//www.codepudding.com/other/39422.html

Prev:Selenium webdriver images click on the download link, computer program to die
Next:Consult about turtle dynamic implementation of python
  •  Tags:  
  • Scripting language (Perl/Python)
  • Related
  • Oracle suddenly card today
  • Why today to begin a new dell 7590 found that more than 60%
  • IOS development, today have a more difficult problem, about
  • From today start to record my msp430f149 MCU bluetooth multi
  • To lead the meeting today, said 35-year-old programmer has t
  • Of the new turn, online etc.!!!!!! Hurry, today want to hand
  • Today found VSC a amazing to debug the error
  • Eva theory of currency: 9-25 ETH midday today market analysi
  • There was a problem in mount disk today
  • From the records in CSDN today, the deceased rest in peace,
  •  Links:  
  • CodePudding

About Us:  Contact Us      Terms of Service       Privacy Policy

Copyright © 2010-2023,Powered By CodePudding