title: Not able to scrape html table from a website using python script
body: <p>I was actually trying to scrape the the <code>"Name"</code> column in the table shown in this <a href="https://myaccount.umn.edu/lookup?SET_INSTITUTION=UMNTC&amp;type=name&amp;CN=University%20of%20Minnesota&amp;campus=a&amp;role=any" rel="nofollow noreferrer">link</a> and save it as a csv file.</p>
  
  <p>I wrote a python script like below:</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import requests
  import csv
  
  
  # Step 1: Sending a HTTP request to a URL
  url = "https://myaccount.umn.edu/lookup?SET_INSTITUTION=UMNTC&amp;type=name&amp;CN=University+of+Minnesota&amp;campus=a&amp;role=any"
  # Make a GET request to fetch the raw HTML content
  html_content = requests.get(url).text
  
  
  # Step 2: Parse the html content
  soup = BeautifulSoup(html_content, "lxml")
  # print(soup.prettify()) # print the parsed data of html
  
  
  # Step 3: Analyze the HTML tag, where your content lives
  # Create a data dictionary to store the data.
  data = {}
  #Get the table having the class wikitable
  gdp_table = soup.find("table")
  gdp_table_data = gdp_table.find_all("th")  # contains 2 rows
  
  # Get all the headings of Lists
  headings = []
  for td in gdp_table_data[0].find_all("td"):
      # remove any newlines and extra spaces from left and right
      headings.append(td.b.text.replace('\n', ' ').strip())
  
  # Get all the 3 tables contained in "gdp_table"
  for table, heading in zip(gdp_table_data[1].find_all("table"), headings):
      # Get headers of table i.e., Rank, Country, GDP.
      t_headers = []
      for th in table.find_all("th"):
          # remove any newlines and extra spaces from left and right
          t_headers.append(th.text.replace('\n', ' ').strip())
  
      # Get all the rows of table
      table_data = []
      for tr in table.tbody.find_all("tr"): # find all tr's from table's tbody
          t_row = {}
          # Each table row is stored in the form of
          # t_row = {'Rank': '', 'Country/Territory': '', 'GDP(US$million)': ''}
  
          # find all td's(3) in tr and zip it with t_header
          for td, th in zip(tr.find_all("td"), t_headers): 
              t_row[th] = td.text.replace('\n', '').strip()
          table_data.append(t_row)
  
      # Put the data for the table with his heading.
      data[heading] = table_data
      print("table_data")
  </code></pre>
  
  <p>But when I run this script I am not getting anything.
  Please help me with this</p>