Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlotteMaher committed Jul 17, 2019
1 parent 80b9a00 commit 303b9e5
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions scraper.py
Expand Up @@ -16,21 +16,27 @@
for companyname in name:
print companyname.text

#Find info on index
info = root.cssselect('dt')
for companyinfo in info:
#Gettomg the descriptive list
list = root.cssselect('dl')
print companylist.text
record = { "companylist" : companylist.text } # column name and value
scraperwiki.sqlite.save(["companylist"], record)

#Find info on index
#info = root.cssselect('dt')
#for companyinfo in info:
#print companyinfo.text
#write out in ordered table
record = { "companyinfo" : companyinfo.text } # column name and value
scraperwiki.sqlite.save(["companyinfo"], record) # save the records one by one
# record = { "companyinfo" : companyinfo.text } # column name and value
# scraperwiki.sqlite.save(["companyinfo"], record) # save the records one by one

#
#Find another thing on the page using css selectors
address = root.cssselect('dd')
for companyaddress in address:
#address = root.cssselect('dd')
#for companyaddress in address:
#print companyaddress.text
record = { "companyaddress" : companyaddress.text } # column name and value
scraperwiki.sqlite.save(["companyaddress"], record) # save the records one by one
# record = { "companyaddress" : companyaddress.text } # column name and value
# scraperwiki.sqlite.save(["companyaddress"], record) # save the records one by one


# # Write out to the sqlite database using scraperwiki library
Expand Down

0 comments on commit 303b9e5

Please sign in to comment.