Neuer Ansatz für den Wettkampfsammler

Changes to be committed:
- kleinere Korrekturen/Verbesserungen
	modified:   homepage/redesign2018/markdownExperiment/Makefile
	modified:   homepage/redesign2018/markdownExperiment/src/jsonSd/cwsvJudo.json
- Neuer Ansatz für den Wettkampfsammler
	new file:   wkOrg/src/wkScraper/scrapyDocAuthorSpider.py
	new file:   wkOrg/src/wkScraper/scrapyDocQuoteSpider.py
	new file:   wkOrg/src/wkScraper/scrapyJvsKalender.py
This commit is contained in:
marko
2018-09-20 14:38:52 +02:00
parent 3ef14f9998
commit 8af477fca8
5 changed files with 90 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import scrapy
class QuotesSpider(scrapy.Spider):
name = "quotes"
start_urls = [
'http://quotes.toscrape.com/tag/humor/',
]
def parse(self, response):
for quote in response.css('div.quote'):
yield {
'text': quote.css('span.text::text').extract_first(),
'author': quote.xpath('span/small/text()').extract_first(),
}
next_page = response.css('li.next a::attr("href")').extract_first()
if next_page is not None:
yield response.follow(next_page, self.parse)