Files
RSSHub-python/rsshub/spiders/csrc/audit.py
2020-02-29 10:56:43 +08:00

39 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import requests
from parsel import Selector
domain = 'https://neris.csrc.gov.cn'
def parse(post):
item = {}
item['title'] = post.css('li.templateTip').css('li::text').extract_first()
audit_status = post.css('td[style="font-weight:100 ;color: black ;position: relative;left:20px"]').css('td::text').extract()
audit_date = post.css('td[style="font-weight:100 ;color:black;position: relative; "]').css('td::text').extract()
description = item['title'] + ''
for i in range(len(audit_status)):
description += '<' + audit_date[i] + ' ' + audit_status[i] + '>\n'
item['title'] += '' + audit_status[-1]
item['description'] = description
item['pubDate'] = audit_date[-1]
return item
def ctx(category=''):
q_url = f"{domain}/alappl/home1/onlinealog.do"
items = []
for i in range(1,4):
q_data = {"appMatrCde": category, "pageNo": str(i), "pageSize": "10"}
res = requests.post(q_url,data=q_data, verify=False)
tree = Selector(res.text)
posts = tree.css('tr[height="50"]')
items.extend(list(map(parse, posts)))
return {
'title': f'申请事项进度查询 - {category} - 中国证监会',
'link': f'{domain}/alappl/home1/onlinealog?appMatrCde={category}',
'description': f'{category} 申请事项进度查询 - 中国证监会',
'author': 'hillerliao',
'items': items
}