CoolFace
Apppublic

ositamiles/Spider-crawler

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
scraper.py20 linesDownload Raw Back to root
1import scrapy2 3class IGDBSpider(scrapy.Spider):4    name = 'igdb_spider'5    start_urls = ['https://www.igdb.com/games/recently_released']6 7    def parse(self, response):8        for game in response.css('div.game_display'):9            yield {10                'title': game.css('h3.name a::text').get(),11                'release_date': game.css('div.release_date span::text').get(),12                'genre': game.css('div.genres span::text').get(),13                'platform': game.css('div.platforms a::text').get(),14                'rating': game.css('div.rating span::text').get()15            }16 17        # Pagination (if available)18        next_page = response.css('a.next_page::attr(href)').get()19        if next_page:20            yield response.follow(next_page, self.parse)