Permalink
Browse files

Minor update

  • Loading branch information...
jacksongs committed Jun 9, 2015
1 parent ba069e4 commit d022853a9d4d9233f4aa21206e934e9a1604355a
Showing with 6 additions and 6 deletions.
  1. +6 −6 scraper.py
View
@@ -12,11 +12,11 @@
data = []
for i, a in enumerate(agentps):
if len(a.find_all("br"))>3:
if a.find_all("br")[0].previousSibling.strip() == 'New South Wales':
data.append({"id": i, name": a.find_all("br")[1].nextSibling.strip(), "company": a.find_all("br")[2].nextSibling.strip(), "location": a.find_all("br")[-1].nextSibling.strip().replace(u'\xa0', u' ')})
else:
data.append({"id": i, "name": a.find_all("br")[0].previousSibling.strip(), "company": a.find_all("br")[1].previousSibling.strip(), "location": a.find_all("br")[-1].nextSibling.strip().replace(u'\xa0', u' ')})
if len(a.find_all("br"))>3:
if a.find_all("br")[0].previousSibling.strip() == 'New South Wales':
data.append({"id": i, "name": a.find_all("br")[1].nextSibling.strip(), "company": a.find_all("br")[2].nextSibling.strip(), "location": a.find_all("br")[-1].nextSibling.strip().replace(u'\xa0', u' ')})
else:
data.append({"id": i, "name": a.find_all("br")[0].previousSibling.strip(), "company": a.find_all("br")[1].previousSibling.strip(), "location": a.find_all("br")[-1].nextSibling.strip().replace(u'\xa0', u' ')})
scraperwiki.sqlite.save(unique_keys=["name","company"], data=data, table_name='agents')

0 comments on commit d022853

Please sign in to comment.