mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-16 15:09:28 +00:00
set item description to title if not exists in pgyer
This commit is contained in:
@@ -7,9 +7,11 @@ domain = 'https://www.pgyer.com'
|
|||||||
def parse(post):
|
def parse(post):
|
||||||
item = {}
|
item = {}
|
||||||
item['title'] = post.xpath('//meta[@property="og:description"]').attrib['content']
|
item['title'] = post.xpath('//meta[@property="og:description"]').attrib['content']
|
||||||
item['description'] = post.css('div.update-description').extract_first()
|
item['description'] = item['title']
|
||||||
item['description'] = re.sub(r'<[^>]*>', '', item['description'] )\
|
if post.css('div.update-description').extract_first():
|
||||||
.split('备注信息:')[1].split('执行人')[0].strip()
|
item['description'] = post.css('div.update-description').extract_first()
|
||||||
|
item['description'] = re.sub(r'<[^>]*>', '', item['description'] )\
|
||||||
|
.split('备注信息:')[1].split('执行人')[0].strip()
|
||||||
link = post.css('img.qrcode').attrib['src'].split('app/qrcode/')
|
link = post.css('img.qrcode').attrib['src'].split('app/qrcode/')
|
||||||
item['link'] = link[0] + link[1]
|
item['link'] = link[0] + link[1]
|
||||||
return item
|
return item
|
||||||
|
|||||||
Reference in New Issue
Block a user