title: 'int' object is not subscriptable (scraping tables from website)
body: <p>I am painfully new to coding... I just learned how to use the terminal approximately one week ago if that gives you any idea of how n00bish I am. I need to learn how to scrape data from websites so I am practicing on websites that I am familiar with, and I'm trying to create a csv file that shows the data from this url: <a href="http://phish.net/song" rel="nofollow noreferrer">http://phish.net/song</a>. I essentially modified code from this site (<a href="https://chihacknight.org/blog/2014/11/26/an-intro-to-web-scraping-with-python.html" rel="nofollow noreferrer">https://chihacknight.org/blog/2014/11/26/an-intro-to-web-scraping-with-python.html</a>) and I'm trying to use it.</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import requests
  import pandas as pd
  url = "http://phish.net/song?"
  r = requests.get(url)
  data = r.text
  soup = BeautifulSoup(data, "lxml")
  table = soup.find('table')
  rows = table.find('tr')
  data = {
  'song': [],
  'original_artist': [],
  'times': [],
  'debut': [],
  'last': [],
  'gap': []
  }
  for row in rows:
      cols = row.find('td')
      data['song'].append(cols[0].get_text()))
      data['original_artist'].append(cols[1].get_text())
      data['times'].append(cols[2].get_text())
      data['debut'].append(cols[3].get_text())
      data['last'].append(cols[4].get_text())
      data['gap'].append(cols[5].get_text())
  phishData = pd.DataFrame(data)
  phishData.to_csv("PhishData.csv")
  </code></pre>
  
  <p>I receive the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "phishnet.py", line 20, in &lt;module&gt;
      data['song'].append(str(cols[0].get_text()))
  TypeError: 'int' object is not subscriptable
  </code></pre>
  
  <p>Which object is the one that's not subscriptable? And how do I fix this problem? Thanks in advance for your help and please tell me if this is not an appropriate use of this forum.</p>