Adding a first implementation of the parse function

This commit is contained in:
edipretoro 2025-12-26 12:14:07 +01:00
parent 6e7a1d3378
commit 34ea401c00

View File

@ -33,7 +33,16 @@ class TvShow(CrawlSpider):
] ]
def parse(self, response): def parse(self, response):
pass for article in response.css("article"):
item = TvShowItem()
item['article_id'] = article.attrib['id'],
item['article_title'] = article.css('h1.entry-title > a::text').get(),
item['title'] = article.css('.entry-summary > p > strong::text').get(),
item['date'] = article.css('.entry-meta-header-before::text').getall()[1].strip(),
item['summary'] = article.xpath('.//div[@class="entry-summary"]/node()').extract(),
item['image_url'] = article.css('.entry-summary > p > img::attr(src)').get(),
item['download_url'] = article.css('.entry-summary > p > a[href ^= "https://rapidgator"]::attr(href)').get()
yield item
def main(): def main():