0

I'm attempting to download college basketball data from barttorvik.com (specifically https://barttorvik.com/team-tables_each.php), a site which aggregates many valuable statistics. There isn't a 'download' link on the site per se, so in order to collect data, one must use a query string including '?csv=1' at the end of the URL. When doing this by hand, in the address bar of my web browser, this works perfectly, and the data is downloaded to my downloads folder with a default name (trank_team_table_data.csv). The problem I'm facing arises when attempting to automate this in a python script. The exact method I use in python is

import pandas as pd
data = pd.read_table('https://barttorvik.com/team-tables_each.php?csv=1', sep=',', encoding='utf-8')

which turns up errors covered in this SO post. Bypassing those errors with the destructive techniques described in that post, the file downloads and opens. However, it seems that this opens the HTML backing up the page itself? Part of the resultant CSV (opened in excel, downloaded using urllib.request) is shown here.

brombeer
  • 8,716
  • 5
  • 21
  • 27
Logan
  • 95
  • 7

0 Answers0