title: Beautiful Soup error: NameError: name 'htmltext' is not defined
body: <p>I'm getting this error:</p>
  
  <pre><code>NameError: name 'htmltext' is not defined
  </code></pre>
  
  <p>It comes from the code below:</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import urllib
  import urllib.parse
  
  url = "http://nytimes.com"
  
  urls = [url]
  visited = [url]
  
  while len(urls) &gt; 0:
          try:
             htmltext = urllib.urlopen(urls[0]).read()
          except:
             print(urls[0])      
  
          soup = BeautifulSoup(htmltext)    
          urls.pop(0)
  
          print(soup.findAll('a',href = true))
  </code></pre>