Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
blablupcom committed May 30, 2018
1 parent 9b9aacd commit cefe65c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scraper.py
Expand Up @@ -100,11 +100,11 @@ def convert_mth_strings ( mth_string ):

links = soup.find_all('a')
for link in links:
file_name = link.text()
if 'Spending' in file_name:
file_name = link.text
if 'Spending' in file_name and '.csv' in link['href']:
url = link['href']
csvYr = file_name.replace('Spending ', '').strip()[-4:]
csvMth = file_name.replace('Spending ', '').strip()[-4:][:3]
csvMth = file_name.replace('Spending ', '').strip()[:3]
csvMth = convert_mth_strings(csvMth.upper())
data.append([csvYr, csvMth, url])

Expand Down

0 comments on commit cefe65c

Please sign in to comment.