Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
blablupcom committed Mar 12, 2018
1 parent 6e18b53 commit 99d77df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scraper.py
Expand Up @@ -108,14 +108,18 @@ def convert_mth_strings ( mth_string ):
except:
break
for block in blocks:
title = block.find_all('td')[3].find('a')['title'].split('for')[-1].strip().split('-')[-1].strip().replace('Spend over £25,000', '').strip().replace('Spend over £25k', '').strip().replace('Items over £25k', '').strip().replace('spend over £25,000 in George Eliot Hospital NHS Trust', '').strip()
title = block.find_all('td')[3].find('a')['title'].split('for')[-1].strip().split('-')[-1].strip().replace('Spend over £25,000', '').strip().replace('Spend over £25k', '').strip().replace('Items over £25k', '').strip().replace('spend over £25,000 in George Eliot Hospital NHS Trust', '').strip().replace('Spend Over £25,000 ', '').strip()
if 'Staff Survey' in title:
continue
url = 'http://www.geh.nhs.uk'+block.find_all('td')[3].find('a')['href']
csvMth = title[:3]
csvYr = title[-4:]
if '2103' in csvYr:
csvYr = '2013'
if ',000' in csvYr:
csvYr = title.split()[1]
if 'y 16' in csvYr:
csvYr = '2016'
csvMth = convert_mth_strings(csvMth.upper())
data.append([csvYr, csvMth, url])

Expand Down

0 comments on commit 99d77df

Please sign in to comment.