remove html tags in chouti search result

This commit is contained in:
hillerliao
2021-06-10 14:38:19 +08:00
committed by GitHub
parent 1b60651eb4
commit 41d2e57a19

View File

@@ -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]