def download_img(url, response, imageFileAll, imageFileInc):

    # + "/" + dateStr + "/"
    if "flipkart" in url:
        flipKartScrapper = FlipKartScrapper()
        flipKartScrapper.downloadProductList(response.content, imageFileInc, imageFileAll)
    if "snapdeal" in url:
        snapdealScrapper = SnapDealScrapper()
        snapdealScrapper.downloadProductList(response.content, imageFileInc, imageFileAll)
    if "amazon" in url:
        amazonScrapper = AmazonScrapper()
        amazonScrapper.downloadProductList(response.content, imageFileInc, imageFileAll)
def download_img(url, response, imageFileAll, imageFileInc):

    #+ "/" + dateStr + "/"
    if ("flipkart" in url):
        flipKartScrapper = FlipKartScrapper()
        flipKartScrapper.downloadProductList(response.content, imageFileInc,
                                             imageFileAll)
    if ("snapdeal" in url):
        snapdealScrapper = SnapDealScrapper()
        snapdealScrapper.downloadProductList(response.content, imageFileInc,
                                             imageFileAll)
    if ("amazon" in url):
        amazonScrapper = AmazonScrapper()
        amazonScrapper.downloadProductList(response.content, imageFileInc,
                                           imageFileAll)
	def parse(self,response,url, brand, productName, product_id, snapDealMatch, amazonMatch):
		productJSON = {}
		if ("flipkart" in url):
			flipKartScrapper = FlipKartScrapper()
			productJSON = flipKartScrapper.downloadProductDetails(response.content, productName, brand)
		if ("snapdeal" in url):
			snapdealScrapper = SnapDealScrapper()
			productJSON = snapdealScrapper.downloadProductDetails(response.content, productName, brand, snapDealMatch)
		if ("amazon" in url):
			amazonScrapper = AmazonScrapper()
			productJSON = amazonScrapper.downloadProductDetails(response.content, productName, brand, amazonMatch)
		
		# self.saveOutPut(productJSON, outputFilePath)
		productJSON['product_id'] = product_id
		productJSON['spec_url'] = response.url
		# print productJSON
		DBOperations.mongoSaveDocument(productJSON,self.SpecificationCollection, self.specificationClient, "product_id", False) 
Пример #4
0
	def parse(self,response,current_dict):
		discount = 0
		price = 0
		stock = 1
		priceDict = {}
		eComName = ""
		productUrl = response.url
		
		
		if ("flipkart" in response.url):
			flipKartScrapper = FlipKartScrapper()
			price, stock, discount, rating, shippingCharges = flipKartScrapper.getPrice(response.content)
			eComName = "flipkart"
			productUrl = response.url + "&affid=bazaarfun"
		if ("snapdeal" in response.url):
			snapdealScrapper = SnapDealScrapper()
			price, stock, discount, rating, shippingCharges = snapdealScrapper.getPrice(response.content)
			eComName = "snapdeal" 
			if '?' in response.url:
				productUrl = response.url + "&utm_source=aff_prog&utm_campaign=afts&offer_id=17&aff_id=50292"
			else:
				productUrl = response.url + "?utm_source=aff_prog&utm_campaign=afts&offer_id=17&aff_id=50292"
		if ("amazon" in response.url):
			amazonScrapper = AmazonScrapper()
			price, stock, discount,rating, shippingCharges = amazonScrapper.getPrice(response.content)
			eComName = "amazon"
			productUrl = response.url + "?tag=bazaarfunda-21"

		priceDict["price"] = price
		priceDict["productUrl"] = productUrl
		priceDict["stock"] = stock
		priceDict["discount"] = discount
		priceDict["rating"] = rating
		priceDict["shipping"] = shippingCharges
		priceDict["website"] = eComName
		return priceDict
Пример #5
0
    def parse(self, response, url, brand, productName, product_id,
              snapDealMatch, amazonMatch):
        productJSON = {}
        if ("flipkart" in url):
            flipKartScrapper = FlipKartScrapper()
            productJSON = flipKartScrapper.downloadProductDetails(
                response.content, productName, brand)
        if ("snapdeal" in url):
            snapdealScrapper = SnapDealScrapper()
            productJSON = snapdealScrapper.downloadProductDetails(
                response.content, productName, brand, snapDealMatch)
        if ("amazon" in url):
            amazonScrapper = AmazonScrapper()
            productJSON = amazonScrapper.downloadProductDetails(
                response.content, productName, brand, amazonMatch)

        # self.saveOutPut(productJSON, outputFilePath)
        productJSON['product_id'] = product_id
        productJSON['spec_url'] = response.url
        # print productJSON
        DBOperations.mongoSaveDocument(productJSON,
                                       self.SpecificationCollection,
                                       self.specificationClient, "product_id",
                                       False)