title: BeautifulSoup 4 with fieldset
body: <p>I was working on a scraper I came across</p>
  
  <p><code>BeautifulSoup("&lt;fieldset&gt; some html &lt;/fieldset&gt;")</code></p>
  
  <p>This gives an error <code>TypeError: 'NoneType' object is not callable</code></p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>soup = BeautifulSoup(res.content)
  categories = soup.findAll('fieldset')
  
  for category in categories:
      print category
      category = BeautifulSoup(category)
  </code></pre>
  
  <p>printing <code>category</code> I got </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;fieldset&gt;
  &lt;a class="box" href="http://example.com"&gt;
  &lt;img src="http://example.png" alt="" /&gt;
  &lt;/a&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p><strong>Stacktrace</strong> </p>
  
  <pre><code>Traceback (most recent call last):
    File "scraper.py", line 40, in &lt;module&gt;
      print get_channels_list()
    File "scraper.py", line 22, in get_channels_list
      category = BeautifulSoup(category)
    File "C:\Anaconda\lib\site-packages\BeautifulSoup.py", line 1522, in __init__
      BeautifulStoneSoup.__init__(self, *args, **kwargs)
    File "C:\Anaconda\lib\site-packages\BeautifulSoup.py", line 1143, in __init__
      markup = markup.read()
  TypeError: 'NoneType' object is not callable
  </code></pre>