title: body=body.encode('ascii','ignore')AttributeError: 'list' object has no attribute 'encode'
body: <p>Why does the following code give me an error message: <code>AttributeError: 'list' object has no attribute 'encode'</code>?</p>
  
  <pre><code>import urllib2                  
  from BeautifulSoup import BeautifulSoup
  
  opener = urllib2.build_opener()         
  opener.addheaders = [('user-agent', 'Mozilla/5.0')]
  
  url = ('http://en.wikipedia.org/wiki/Pink_Floyd')
  
  thisurl= opener.open(url).read()
  
  soup = BeautifulSoup(thisurl)      
  title = soup.title.text
  
  body = soup.findAll('p')       
  body = body.encode('ascii','ignore')
  
  for i in body:         
      print i.text
  </code></pre>