Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import scrapy
- from scrapy.spiders import Rule
- from scrapy.linkextractors import LinkExtractor
- class RastellimarketSpider(scrapy.Spider):
- name = 'rastellimarket'
- allowed_domains = ['shop.rastellimarket.com']
- start_urls = ['https://shop.rastellimarket.com/shop/#!/?page=%s' % page for page in range(1, 1366)]
- rules = (
- Rule(LinkExtractor(allow=('products',)), callback='parse'),
- )
- def parse(self, response):
- self.logger.info(response.url)
- yield scrapy.Request(response.url, callback=self.parse_item)
- def parse_item(self, response):
- a = response.xpath(".//div[@class='fp-item-image fp-item-image-md']/a/@href").get()
- print(a)
Add Comment
Please, Sign In to add comment