mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-06-02 15:10:16 +00:00
add xinhuanet (news.cn)
Signed-off-by: icedragon <flyingicedragon@qq.com>
This commit is contained in:
14
rsshub/spiders/xinhuanet/utils.py
Normal file
14
rsshub/spiders/xinhuanet/utils.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from rsshub.utils import DEFAULT_HEADERS, fetch
|
||||
|
||||
|
||||
def parse_html(post):
|
||||
item = {}
|
||||
item['title'] = post.xpath('text()').extract_first()
|
||||
item['link'] = post.xpath('@href').extract_first()
|
||||
print(item['link'])
|
||||
item['description'] = (
|
||||
fetch(item['link'], headers=DEFAULT_HEADERS)
|
||||
.xpath('//div[@id=\'detail\']')
|
||||
.get()
|
||||
)
|
||||
return item
|
||||
Reference in New Issue
Block a user