From 959669381b6259684082a9c0c377f812abd43dfc Mon Sep 17 00:00:00 2001 From: alphardex <2582347430@qq.com> Date: Thu, 17 Jan 2019 10:25:27 +0800 Subject: [PATCH] chuansongme full text crawl --- rsshub/spiders/chuansongme/articles.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rsshub/spiders/chuansongme/articles.py b/rsshub/spiders/chuansongme/articles.py index f3e2468..7385feb 100644 --- a/rsshub/spiders/chuansongme/articles.py +++ b/rsshub/spiders/chuansongme/articles.py @@ -6,7 +6,12 @@ domain = 'https://chuansongme.com' def parse(post): item = {} item['title'] = post.css('a.question_link::text').extract()[-1].strip() - item['link'] = f"{domain}{post.css('a.question_link::attr(href)').extract_first()}" + link = f"{domain}{post.css('a.question_link::attr(href)').extract_first()}" + item['link'] = link + try: + item['description'] = '\n'.join(fetch(link).css('p span::text').extract()) + except AttributeError: + pass return item