title: Scraping paginated web table with python pandas & beautifulSoup
body: <p>I am a beginner in python pandas, i am trying to scrap a paginated table using beautiful soup package, the data is scraped, but the content of each cell comes in a single row, i couldn't get a coherent csv file</p>
  
  <p>here is my code : </p>
  
  <pre><code>import urllib
  import urllib.request
  from bs4 import BeautifulSoup
  import os
  
  file=open(os.path.expanduser("sites_commerciaux.csv"), "wb")
  
  def make_soup(url):
      thepage=urllib.request.urlopen(url)
      soupdata=BeautifulSoup(thepage,"html.parser")
      return soupdata
  
  
  headers="Nom_commercial_du_Site,Ville,Etat,Surface_GLA,Nombre_de_boutique,Contact"
  file.write(bytes(headers,encoding='ascii',errors='ignore'))
  save=""
  for num in range(0,22): 
      soup=make_soup("http://www.ceetrus.com/fr/implantations-sites-commerciaux?page="+str(num))
      for rec in soup.findAll('tr'):
          saverec=""
          for data in rec.findAll('td'):
              saverec=saverec+","+data.text
              if len(saverec)!=0:
               save=save+"\n"+saverec[1:]
  
  file.write(bytes(save,encoding='ascii',errors='ignore'))
  </code></pre>
  
  <p>can anyone help me fix it please</p>