Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mxfh committed Oct 26, 2014
1 parent 36d8b95 commit 234ccdc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scraper.py
Expand Up @@ -21,6 +21,7 @@ def iriToUri(iri):
html = scraperwiki.scrape(url) # download the html content of the page
soup = BeautifulSoup(html) # load the html into beautifulsoup

i = 0
bezirke = []
orte = []
events = []
Expand Down Expand Up @@ -61,7 +62,8 @@ def iriToUri(iri):
date = ttuple.date()
print(bezirk, ort, datum, teilnehmermax, einwohner, kirche, demo)
events.append({
"id" : bezirk + ort + datum,
"id" : i,
"uniq" : bezirk + ort + datum,
"bezirk": bezirk,
"ort": ort,
"datum": datum,
Expand All @@ -80,4 +82,5 @@ def iriToUri(iri):
"demo": demo,
"kirche": kirche
})
i++;
scraperwiki.sqlite.save(unique_keys=["id"], data=evententries)

0 comments on commit 234ccdc

Please sign in to comment.