Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scrapy
- class QuotesSpider(scrapy.Spider):
- name = 'quotes'
- start_urls = [
- 'https://www.cannabisonlinedispensary.net/product-category/marijuana-strains/'
- ]
- def parse(self, response):
- for quote in response.css('div.card card-product'):
- yield {
- 'category': quote.css('li.product h6 a::text').get(),
- 'sort': quote.css('div.content a.shop-item-title-link::text').get(),
- }
- next_page = response.css('.next::attr("href")').get()
- if next_page is not None:
- yield response.follow(next_page, self.parse)
Add Comment
Please, Sign In to add comment