Updating the extraction of fields
This commit is contained in:
parent
ada99be262
commit
15e1f837c8
14
scrarls.py
14
scrarls.py
@ -54,13 +54,13 @@ class TvShow(CrawlSpider):
|
||||
def parse(self, response):
|
||||
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:nth-child(4) > strong::text').get(),
|
||||
item['date'] = self.parse_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()
|
||||
item['post_id'] = article.attrib['id']
|
||||
item['post_title'] = article.css('h1.entry-title > a::text').get()
|
||||
item['title'] = article.css('.entry-summary > p:nth-child(4) > strong::text').get()
|
||||
item['date'] = self.parse_date(article.css('.entry-meta-header-before::text').getall()[1].strip())
|
||||
item['summary'] = "".join(article.xpath('.//div[@class="entry-summary"]/node()').extract())
|
||||
item['image_url'] = article.css('.entry-summary > p > img::attr(src)').get()
|
||||
item['download_url'] = "#".join(article.css('.entry-summary > p > a[href ^= "https://rapidgator"]::attr(href)').extract())
|
||||
yield item
|
||||
|
||||
def parse_date(self, formatted_date: str):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user