title: Problems with navigablestrings and unicode in BeautifulSoup
body: <p>I am having some problems with navigablestrings and unicode in BeautifulSoup (python).</p>
  
  <p>Basically, I am parsing four results pages from youtube, and putting the top result's extension (end of the url after youtube.com/watch?=) into a list.</p>
  
  <p>I then loop the list in two other functions, on one, it throws this error: <code>TypeError: 'NavigableString' object is not callable</code>. However, the other one says <code>TypeError: 'unicode' object is not callable</code>. Both are using the same exact string.</p>
  
  <p>What am I doing wrong here? I know that my parsing code is probably not perfect, I'm using both BeautifulSoup and regex. In the past whenever I get NavigableString errors, I have just thrown in a ".encode('ascii', 'ignore') or simply str(), and that has seemed to work. Any help would be appreciated!</p>
  
  <pre><code>    for url in urls:
          response = urllib2.urlopen(url)
          html = response.read()
          soup = BeautifulSoup(html)
          link_data = soup.findAll("a", {"class":"yt-uix-tile-link result-item-translation-title"})[0]
          ext = re.findall('href="/(.*)"&gt;', str(link_data))[0]
          if isinstance(ext, str):
              exts.append('http://www.youtube.com/'+ext.replace(' ',''))
  </code></pre>
  
  <p>and then:</p>
  
  <pre><code>    for ext in exts:
          description = description(ext)
          embed = embed(ext)
  </code></pre>
  
  <p>i only added the isinstance() lines to try and see what the problem was. When 'str' is changed to 'unicode', the exts list is empty (meaning they are strings, not unicode (or even navigablestrings?)). I'm quite confused...</p>