title: AttributeError: 'NoneType' object has no attribute 'encode'
body: <p>I am using Python to get urls and modify them.
  here is where this error occur:</p>
  
  <pre><code>for link in soup.findAll('a'):
      linkori = (link.get('href'))
      print 'LINKORI : %s' %linkori
      fonte1 = linkori
      fonte1 = str(fonte1.encode('utf8'))
  </code></pre>
  
  <p>My traceback:</p>
  
  <pre><code>  File "C:\Python27\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript
      exec codeObject in __main__.__dict__
    File "F:\Docs\Projti\Rafael\Python Scripts\final.py", line 258, in &lt;module&gt;
      fonte1 = str(fonte1.encode('utf8'))
  AttributeError: 'NoneType' object has no attribute 'encode'
  </code></pre>
  
  <p>I tried <code>.join</code> or something else but I always get the same error. When I print <code>linkori</code> it displays the url from <code>link.get</code> perfectly.
  Can someone tell me what is wrong?</p>