From 41d2e57a195baeab1daf793dab4c1ec88adc8dd3 Mon Sep 17 00:00:00 2001 From: hillerliao Date: Thu, 10 Jun 2021 14:38:19 +0800 Subject: [PATCH] remove html tags in chouti search result --- rsshub/spiders/chouti/search.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rsshub/spiders/chouti/search.py b/rsshub/spiders/chouti/search.py index 7a5f5e9..6e65d4e 100644 --- a/rsshub/spiders/chouti/search.py +++ b/rsshub/spiders/chouti/search.py @@ -1,3 +1,4 @@ +import re import requests from rsshub.utils import DEFAULT_HEADERS @@ -6,7 +7,7 @@ domain = 'https://dig.chouti.com' def parse(post): item = {} - item['title'] = post['title'] + item['title'] = re.sub(r'<[^>]*>', '', post['title']).strip() item['description'] = post['title'] item['link'] = 'https://dig.chouti.com/link/' + str(post['id']) item['pubDate'] = str(post['created_time'])[0:10]