Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
watty62 committed Oct 12, 2016
1 parent c6b7422 commit 24a6e06
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scraper.py
Expand Up @@ -9,23 +9,25 @@
# # Read in a page
# scrape_add = ""

def extract_ints (s):
ret_int = [int(s) for s in str.split() if s.isdigit()]
return ret_int[1]

def scrape_URL (url_no):
scrape_add = "http://www.grampiancaredata.gov.uk/home?sobi2Task=sobi2Details&sobi2Id=" + str(url_no)
html = scraperwiki.scrape(scrape_add)
root = lxml.html.fromstring(html)

#set up variables
rec_no = 0
services = ""

# get the rec_no
el = root.cssselect("div#sobi2outer p")[0]
rec_no = str( el.text [14:].strip())
print rec_no

# get services
el = root.cssselect ("div#FirstTab p") [0]
services = el.text
print services

return "true"

# lower_rec = 16
Expand Down

0 comments on commit 24a6e06

Please sign in to comment.