Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
viACHIZv committed Jan 22, 2020
1 parent 58d1431 commit 9a08287
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scraper.py
Expand Up @@ -53,7 +53,7 @@
from io import BytesIO, TextIOWrapper
from zipfile import ZipFile
import csv
from collections import OrderedDict
# from collections import OrderedDict
import json


Expand All @@ -73,10 +73,10 @@ def utf_8_encoder(unicode_csv_data):
print("Done reading CSV")
head = reader[0]
print(head)
data = reader
data = reader[1:]
table = []
for i in data:
reader = OrderedDict(zip(head, i))
reader = dict(zip(head, i))
table.append(reader)
scraperwiki.sqlite.save(['ariregistri_kood'], data=json.dumps(table), table_name='ee-companies')
scraperwiki.sqlite.save(['ariregistri_kood'], data=table, table_name='ee-companies')
# scraperwiki.sqlite.save(unique_keys=['name'], data=[{"name": "susan", "occupation": "software developer"},{"name": "david", "occupation": "developer"}])

0 comments on commit 9a08287

Please sign in to comment.