Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tomatolichy committed Sep 21, 2018
1 parent 956ce73 commit a6e1b04
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions scraper.py
Expand Up @@ -16,20 +16,26 @@

#html = scraperwiki.scrape("https://uk.webuy.com/product-detail/?id=sssdtosxg51tbpci")

url = "https://uk.webuy.com/product-detail/?id=sssdtosxg51tbpc"
doc_text = scraperwiki.scrape(url)
doc = html.fromstring(doc_text)
#url = "https://uk.webuy.com/product-detail/?id=sssdtosxg51tbpc"
#doc_text = scraperwiki.scrape(url)
#doc = html.fromstring(doc_text)

# # Find something on the page using css selectors


root = lxml.html.fromstring(html)
root.cssselect("<span style="line-height: 17px !important; margin: 1px 1px 3px;")
#root = lxml.html.fromstring(html)
#root.cssselect("<span style="line-height: 17px !important; margin: 1px 1px 3px;")
#
# # Write out to the sqlite database using scraperwiki library

scraperwiki.sqlite.save(unique_keys=['name'], data={"name": "susan", "occupation": "software developer"})
#
#scraperwiki.sqlite.save(unique_keys=['name'], data={"name": "susan", "occupation": "software developer"})

url = "http://www-news.iaea.org/EventList.aspx"
doc_text = scraperwiki.scrape(url)
doc = html.fromstring(doc_text)



# # An arbitrary query against the database
# scraperwiki.sql.select("* from data where 'name'='peter'")

Expand Down

0 comments on commit a6e1b04

Please sign in to comment.