title: TypeError: 'NoneType' object is not callable, BeautifulSoup
body: <p>I'm running into a strange error. I'm trying to do some basic parsing. Essentially, I'm gathering data in 'x' format, and want to return everything in a format that I can use. My immediate issue is that my code is returning a strange error. I have looked through some of the other posts / answers on here for the same issue, but out of context... it is truly hard to pinpoint the issue. </p>
  
  <pre><code>data = url.text
  
  soup = BeautifulSoup(data, "html5lib")
  
  results = [] # this is what my result set will end up as
  
  def parseDiv(text):
      #function takes one input parameter - a single div for which it will parse for specific items, and return it all as a dictionary
      soup2 = BeautifulSoup(text)
      title = soup2.find("a", "yschttl spt")
      print title.text
      print
  
      return title.text
  
  for result in soup.find_all("div", "res"):
      """
      This is where the data is first handled - this would return a div with links, text, etc -
      So, I pass the blurb of text into the parseDiv() function
      """
      item = parseDiv(result)
      results.append(item)
  </code></pre>
  
  <p>Obviously at this point, I've included my needed libraries... When I pull the code for soup2 (the second instantiation of bs4 on my new blurbs of text to be processed), and just print the input of my function, it all works.</p>
  
  <p>Here is the error: </p>
  
  <pre><code>Traceback (most recent call last):
    File "testdata.py", line 29, in &lt;module&gt;
      item = parseDiv(result)
    File "testdata.py", line 17, in parseDiv
      soup2 = BeautifulSoup(text)
    File "C:\Python27\lib\site-packages\bs4\__i
      markup = markup.read()
  TypeError: 'NoneType' object is not callable
  </code></pre>