19 lines
527 B
Python
19 lines
527 B
Python
"""
|
|
Was ist zu tun?
|
|
Erstellen Sie mittels Scrapy einen Web Crawler für die in Ü11 Website beschriebenen Website.
|
|
Lassen Sie Ihr Programm laufen und geben Sie die Daten in output.json aus.
|
|
Laden Sie das Python-Programm als auch output.json in diese Aufgabe hoch.
|
|
"""
|
|
|
|
import scrapy
|
|
|
|
class MySpider(scrapy.Spider):
|
|
url = "https://books.toscrape.com/"
|
|
output_file = "output.json"
|
|
|
|
def start_requests(self):
|
|
yield scrapy.Request(url=self.url, callback=self.parse)
|
|
|
|
def parse(self, response):
|
|
pass
|