mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-17 15:09:31 +00:00
fall back to xinhuanet world
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
from time import sleep
|
|
||||||
from rsshub.utils import DEFAULT_HEADERS, fetch
|
from rsshub.utils import DEFAULT_HEADERS, fetch
|
||||||
|
|
||||||
|
|
||||||
@@ -6,10 +5,10 @@ def parse_html(post):
|
|||||||
item = {}
|
item = {}
|
||||||
item['title'] = post.xpath('text()').extract_first()
|
item['title'] = post.xpath('text()').extract_first()
|
||||||
item['link'] = post.xpath('@href').extract_first()
|
item['link'] = post.xpath('@href').extract_first()
|
||||||
html = fetch(item['link'], headers=DEFAULT_HEADERS)
|
print(item['link'])
|
||||||
item['description'] = (
|
item['description'] = (
|
||||||
html
|
fetch(item['link'], headers=DEFAULT_HEADERS)
|
||||||
.xpath('//div[@id="detail"]')
|
.xpath('//div[@id=\'detail\']')
|
||||||
.get()
|
.get()
|
||||||
)
|
)
|
||||||
return item
|
return item
|
||||||
|
|||||||
Reference in New Issue
Block a user