Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrobenito committed May 7, 2017
1 parent 858a152 commit 4638247
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scraper.py
@@ -1,15 +1,15 @@
# This is a template for a Python scraper on morph.io (https://morph.io)
# including some code snippets below that you should find helpful

# import scraperwiki
# import lxml.html
import scraperwiki
import lxml.html
#
# # Read in a page
# html = scraperwiki.scrape("http://foo.com")
html = scraperwiki.scrape("http://www.bbc.co.uk/radio4/programmes/schedules")
#
# # Find something on the page using css selectors
# root = lxml.html.fromstring(html)
# root.cssselect("div[align='left']")
root = lxml.html.fromstring(html)
root.cssselect("span[property='name']")
#
# # Write out to the sqlite database using scraperwiki library
# scraperwiki.sqlite.save(unique_keys=['name'], data={"name": "susan", "occupation": "software developer"})
Expand Down

0 comments on commit 4638247

Please sign in to comment.