title: Extracting properly data with bs4?
body: <p>Here is my first question on this site as I have tried many ways to get what I want but I didnt succeed..
  I try to extract 2 types of data from a french website similar to CraigList.
  My need is simple and I manage to get those information but I still have tags and other signs in my extract. I also have issue with encoding even if using .encode(utf-8).</p>
  
  
  
  <pre><code># -*- coding: utf-8 -*-
  from urllib.request import urlopen
  from bs4 import BeautifulSoup
  import re
  import csv
  
  csvfile=open("test.csv", 'w+')
  
  html=urlopen("http://www.leboncoin.fr/annonces/offres/ile_de_france/")
  
  bsObj=BeautifulSoup(html)
  article= bsObj.findAll("h2",{"class":"title"})
  prix=bsObj.findAll("div",{"class":"price"})
  
  for art in article:
      art=art.text.encode('utf-8')
  
  print(article)
  
  for prix1 in prix:
      prix1=prix1.text.encode('utf-8')
      print(prix1)
  
  #Pour merger 2 listes (en deux colonnes, pas a la suite)
  table_2=list(zip(article,prix))
  
  try:
      writer=csv.writer(csvfile)
      writer.writerow(('Article', 'Prix'))
  
      for i in table_2:
          writer.writerow([i])
  
  finally:
      csvfile.close()
  </code></pre>
  
  <p>When running this code:</p>
  
  <ul>
  <li>My output contains , etc.. although I have run:</li>
  </ul>
  
  <p>for art in article:
          art=art.text.encode('utf-8')</p>
  
  <ul>
  <li>Sometimes the encoding does not work due to "€" or "-" signs in the name o the product</li>
  </ul>
  
  <p>My questions are:</p>
  
  <ul>
  <li>Why do the ".text.encode()" does not clean the tags from my article object?</li>
  <li>Why do I still get issue with encoding?</li>
  </ul>
  
  <p>I guess I am not using the function as expected but despite my tests I do not get to the result..</p>
  
  <p>Thank you in advance for your insights.</p>
  
  <p>Cheers</p>
  
  <p>Jo</p>