Exemplo n.º 1
0
 def parse_product(self, response):
     name = response.css('.productName ::text').extract_first().strip()
     price = parse.parse_price(
         response.css('.skuBestPrice ::text').extract_first())
     url = response.url
     weights = response.css('.group_1 label ::text').extract()
     weight = parse.parse_price(weights[-1])
     image = response.css('#image-main ::attr(src)').extract_first()
     item = self.to_item(store=self.store,
                         name=name,
                         price=price,
                         image=image,
                         weight=weight,
                         url=url,
                         category=product_type.WHEY_PROTEIN)
     return item
Exemplo n.º 2
0
 def parse_product(self, product):
     name = product.css('.product-name ::text').extract_first()
     if product_type.is_wheyprotein(name):
         price = parse.parse_price(product.css('.price_boleto_discount ::text').extract_first())
         image = product.css('img::attr(src)').extract_first()
         weight = parse.parse_weight(name)
         url = product.css('.product-image ::attr(href)').extract_first()
         item = self.to_item(store=self.store, name=name, price=price, image=image, weight=weight, url=url, category=product_type.WHEY_PROTEIN)
         return item
Exemplo n.º 3
0
 def parse_product(self, product):
     name = product.css('a.name ::text').extract_first().strip()
     price = parse.parse_price(
         product.css(
             '.condition.generic-price ::attr(data-price)').extract_first())
     image = product.css('img::attr(src)').extract_first()
     weight = parse.parse_weight(name)
     url = product.css('.link::attr(href)').extract_first()
     item = self.to_item(store=self.store,
                         name=name,
                         price=price,
                         image=image,
                         weight=weight,
                         url=url,
                         category=product_type.WHEY_PROTEIN)
     return item
Exemplo n.º 4
0
 def parse_product(self, product):
     name = product.css('.product-name ::text').extract_first()
     price = parse.parse_price(
         product.css('.product-off-price ::text').extract_first())
     image = product.css(
         '.product-image > img::attr(data-src)').extract_first()
     weight = parse.parse_weight(name)
     url = 'https://www.gsnsuplementos.com.br' + product.css(
         'a ::attr(href)').extract_first()
     item = self.to_item(store=self.store,
                         name=name,
                         price=price,
                         image=image,
                         weight=weight,
                         url=url,
                         category=product_type.WHEY_PROTEIN)
     return item