title: Export table to excel table
body: <p>Hi I'm trying to export a table present in a site, when I open the csv file I find myself exported only the first row and in the execution of the code it returns me</p>
  <blockquote>
  <p>cannot set a row with mismatched columns</p>
  </blockquote>
  <p>the code:</p>
  <pre><code>from curses import color_content
  from email import header
  from lib2to3.pgen2.token import COLONEQUAL
  from wsgiref import headers
  import requests 
  from bs4 import BeautifulSoup
  import pandas as pd
  
  #page to access 
  url = 'site.xxx'
  
  #request.get
  
  page = requests.get(url)
  
  #beatifulSoup
  
  soup = BeautifulSoup(page.text, 'lxml')
  
  #extract table
  
  table1=soup.find('table',id='table28')
  
  #extract column
  
  headers = []
  for i in table1.find_all('th'):
     title = i.text
     headers.append(title)
  
  #create dataframe
  
  mydata=pd.DataFrame(columns=headers)
  
  # Create a for loop to fill mydata
  for j in table1.find_all('tr')[1:]:
      row_data = j.find_all('td')
      row = [i.text for i in row_data]
      length = len(mydata)
      mydata.loc[length] = row
  
  
  
  # Export to csv
  mydata.to_csv('classifica_piloti2.csv', index=False)# Try to read csv
  mydata2 = pd.read_csv('classifica_piloti2.csv')
  </code></pre>