File size: 780 Bytes
6164210
63aae1c
3745891
 
 
63aae1c
 
3745891
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import scrapy

class IGDBSpider(scrapy.Spider):
    name = 'igdb_spider'
    start_urls = ['https://www.igdb.com/games/recently_released']

    def parse(self, response):
        for game in response.css('div.game_display'):
            yield {
                'title': game.css('h3.name a::text').get(),
                'release_date': game.css('div.release_date span::text').get(),
                'genre': game.css('div.genres span::text').get(),
                'platform': game.css('div.platforms a::text').get(),
                'rating': game.css('div.rating span::text').get()
            }

        # Pagination (if available)
        next_page = response.css('a.next_page::attr(href)').get()
        if next_page:
            yield response.follow(next_page, self.parse)