From c882d9d7a3b312165e248cc221b9e832a0c6f049 Mon Sep 17 00:00:00 2001 From: Leif Greiss Date: Fri, 1 Dec 2017 13:06:51 -0500 Subject: [PATCH] Update scraper.py --- scraper.py | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/scraper.py b/scraper.py index 69bea68..512112b 100644 --- a/scraper.py +++ b/scraper.py @@ -1,24 +1,3 @@ -# 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 -# -# # Read in a page -# html = scraperwiki.scrape("http://foo.com") -# -# # Find something on the page using css selectors -# root = lxml.html.fromstring(html) -# root.cssselect("div[align='left']") -# -# # Write out to the sqlite database using scraperwiki library -# scraperwiki.sqlite.save(unique_keys=['name'], data={"name": "susan", "occupation": "software developer"}) -# -# # An arbitrary query against the database -# scraperwiki.sql.select("* from data where 'name'='peter'") - -# You don't have to do things with the ScraperWiki and lxml libraries. -# You can use whatever libraries you want: https://morph.io/documentation/python -# All that matters is that your final data is written to an SQLite database -# called "data.sqlite" in the current working directory which has at least a table -# called "data". +import scraperwiki +html = scraperwiki.scrape('https://scraperwiki.com/hello_world.html') +print html