Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scrapy
- class QuotesSpider(scrapy.Spider):
- name = "quotes_pt2"
- start_urls = ['http://quotes.toscrape.com/page/1/',
- 'http://quotes.toscrape.com/page/2/',
- ]
- def parse(self, response):
- for quote in response.css('div.quote'):
- yield {
- 'text' : quote.css('span.text::text').get(),
- 'author' : quote.css('small.author::text').get(),
- 'tags' : quote.css('div.tags a.tag::text').getall(),
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement