A
Size: a a a
AR
B
A
def _content_checker(self, content):
if len(content) == 0:
raise CloseSpider('No more pages with contents!')
def parse(self, response):
tags = set(response.xpath('//a[@class="tag"]//text()').getall())
authors = set(response.xpath('//small[@class="author"]//text()').getall())
text = response.xpath('//div[@class="col-md-8"]//span[@class="text"]//text()').getall()
QuotesSpider._content_checker(self, authors)
QuotesSpider._tags_parse(self, tags)
QuotesSpider._authors_parse(self, authors)
QuotesSpider._text_parse(self, text)
with open('tags.txt', 'w') as f:
f.write(str(QuotesSpider.result))
D
AR
AR
A
D
AR
AR
D
AR
AR
A
AR
AR
AR