title: Python Beautiful Soup .content Property
body: <p>What does BeautifulSoup's .content do? I am working through <a href="http://www.crummy.com/software/BeautifulSoup/bs3/documentation.html" rel="noreferrer">crummy.com's</a> tutorial and I don't really understand what .content does. I have looked at the forums and I have not seen any answers.  Looking at the code below....</p>
  
  <pre><code>from BeautifulSoup import BeautifulSoup
  import re
  
  
  
  doc = ['&lt;html&gt;&lt;head&gt;&lt;title&gt;Page title&lt;/title&gt;&lt;/head&gt;',
         '&lt;body&gt;&lt;p id="firstpara" align="center"&gt;This is paragraph &lt;b&gt;one&lt;/b&gt;.',
          '&lt;p id="secondpara" align="blah"&gt;This is paragraph &lt;b&gt;two&lt;/b&gt;.',
          '&lt;/html&gt;']
  
  soup = BeautifulSoup(''.join(doc))
  print soup.contents[0].contents[0].contents[0].contents[0].name
  </code></pre>
  
  <p>I would expect the last line of the code to print out 'body' instead of...</p>
  
  <pre><code>  File "pe_ratio.py", line 29, in &lt;module&gt;
      print soup.contents[0].contents[0].contents[0].contents[0].name
    File "C:\Python27\lib\BeautifulSoup.py", line 473, in __getattr__
      raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__.__name__, attr)
  AttributeError: 'NavigableString' object has no attribute 'name'
  </code></pre>
  
  <p>Is .content only concerned with html, head and title? If, so why is that?</p>
  
  <p>Thanks for the help in advance.</p>