Subversion Repositories SmartDukaan

Rev

Rev 13832 | Rev 13871 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13832 Rev 13846
Line 25... Line 25...
25
def scrapeAmazon():
25
def scrapeAmazon():
26
    amazonBestSellers = list(get_mongo_connection().Catalog.MasterData.find({'rank':{'$gt':0},'source_id':1}))
26
    amazonBestSellers = list(get_mongo_connection().Catalog.MasterData.find({'rank':{'$gt':0},'source_id':1}))
27
    for data in amazonBestSellers:
27
    for data in amazonBestSellers:
28
        inStock = 0
28
        inStock = 0
29
        print str(data['identifier'])
29
        print str(data['identifier'])
30
        if data['identifier'] is None or len(data['identifier'])==0:
30
        if data['identifier'] is None or len(data['identifier'].strip())==0:
31
            print "continue"
31
            print "continue"
32
            continue
32
            continue
33
        
33
        
34
        url = "http://www.amazon.in/gp/offer-listing/%s/ref=olp_sort_ps"%(data['identifier'])
34
        url = "http://www.amazon.in/gp/offer-listing/%s/ref=olp_sort_ps"%(data['identifier'])
35
        print url
35
        print url