tutorial-pyconus2024-gather.../code/exercise-2.py
2024-05-12 10:18:16 -03:00

16 lines
No EOL
369 B
Python

import scrapy
class QuotesScrollSpider(scrapy.Spider):
name = "quotes_scroll"
allowed_domains = ["quotes.toscrape.com"]
def start_requests(self):
# What would be a good first request for this spider?
...
def parse(self, response):
# API response is a JSON content
data = response.json()
# Parse the data here