From 2f9abd61004c7a1c90379d75ad03b541178848fb Mon Sep 17 00:00:00 2001 From: Dominic Jones Date: Wed, 29 Oct 2014 16:10:17 +0000 Subject: [PATCH] 1.2.1.8 --- scraper.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scraper.py b/scraper.py index 250fe16..bd32f80 100644 --- a/scraper.py +++ b/scraper.py @@ -21,12 +21,11 @@ def __init__(self, name, qty, url, ID, price): x=0 for el in root.cssselect("div#property_table_109 table tr"): print lxml.html.tostring(el) - #kingspan.append Product("Kingspan50",1,"buildingmaterials.co.uk",el.cssselect("td")[2].text,el.cssselect("td")[3].text) - print x - print el.cssselect("td")[0].text + if x> 0: + kingspan.append Product(el.cssselect("td")[0],1,"buildingmaterials.co.uk",el.cssselect("td")[2].text,el.cssselect("td")[3].text) x=x+1 - +print kingspan # # # Write out to the sqlite database using scraperwiki library # scraperwiki.sqlite.save(unique_keys=['name'], data={"name": "susan", "occupation": "software developer"})