Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
meandu229 committed May 17, 2016
1 parent bd84993 commit 530f5b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scraper.py
Expand Up @@ -19,12 +19,12 @@ def getAndStoreRandomComic():
frame = root.cssselect("div.entry-content")[0]
url = frame.cssselect('img')[0].get('src')
print str(url)
#ret = scraperwiki.sql.select("* from data where 'url'='"+str(url)+"'")
ret = scraperwiki.sql.select("* from data where 'url'='"+str(url)+"'")
text = root.cssselect('h1.entry-title')[0].text
print text
if(len(ret) == 0):
scraperwiki.sqlite.save(unique_keys=['url'], data={"url": str(url), "text" : text})
getAndStoreRandomComic();
#getAndStoreRandomComic();
for x in range(0,200):
try:
getAndStoreRandomComic();
Expand Down

0 comments on commit 530f5b9

Please sign in to comment.