title: get content in HTML where name= 'XXX ' using python
body: <p>I use python 2.7 in Windows 7.</p>
  
  <p>I have a HTML file and I want to get the content where name='XXX'</p>
  
  <p>My code: </p>
  
  <pre><code>import bs4
  exampleFile = open('test.html')
  exampleSoup = bs4.BeautifulSoup(exampleFile.read(), 'html5lib')
  for item in  exampleSoup.find(name="XXX"):
  print item.get_text()
  </code></pre>
  
  <p>My HTML file:</p>
  
  <pre><code>&lt;h1&gt;&lt;a name="XXX"&gt;&lt;/a&gt;StubStr&lt;/h1&gt;
  &lt;table width="100%" border="1" bordercolor="black" cellspacing="0" cellpadding="5"&gt;
  &lt;tr align=center valign=top&gt;
  &lt;td width="20%" style='width:20%' align=left&gt;Number (psid)&lt;/th&gt;
  &lt;td width="20%" style='width:20%' align=left&gt;0x0002&lt;/th&gt;
  &lt;td width="60%" style='width:60%' align=left&gt;2&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Type&lt;/td&gt;&lt;td colspan=2&gt;octet_string&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Default&lt;/td&gt;&lt;td colspan=2&gt;None&lt;/td&gt; 
   &lt;/tr&gt; 
   &lt;tr&gt;
  &lt;th colspan=3 align=left valign=top&gt;Allowed Values&lt;/th&gt;
  &lt;/tr&gt;
   &lt;tr&gt;&lt;td&gt;Minimum string length&lt;/td&gt;&lt;td colspan=2&gt;0 octets&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Maximum string length&lt;/td&gt; 
   &lt;td colspan=2&gt;128 octets&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=3 align=left valign=top&gt;&lt;p&gt;&lt;b&gt;Dummy string MIB 
  entry
   &lt;/b&gt;&lt;/p&gt;&lt;p&gt;A MIB string entry that can be harmlessly read or written, e.g.,
    for testing.
  </code></pre>
  
  <p>I want to get these text: A MIB string entry that can be harmlessly read or written, e.g.,
  for testing.</p>
  
  <p>But I failed to get the that using my code :TypeError: 'NoneType' object is not iterable</p>