diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2012-07-13 14:54:10 +0200 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2012-07-13 14:54:10 +0200 |
commit | 82a02bfae556f1a5709acb43df631108587547b8 (patch) | |
tree | 8d4c5721439ab8343d7415c290cfab3a249a704a /testlib/scraperwiki.py | |
parent | aa84ea74af30b388221244b944239e85ea689db2 (diff) |
Add test script to run scrapers locally.
Diffstat (limited to 'testlib/scraperwiki.py')
-rw-r--r-- | testlib/scraperwiki.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testlib/scraperwiki.py b/testlib/scraperwiki.py new file mode 100644 index 0000000..baf2b57 --- /dev/null +++ b/testlib/scraperwiki.py @@ -0,0 +1,12 @@ +def scrape(url): + print "Scraping %s" % url + if -1 != url.find("file://"): + f = open(url.replace("file://", ""), "r") + content = f.read() + f.close() + return content + else: + return "" + +def pdftoxml(pdfcontent, options): + return pdfcontent |