fall back to xinhuanet world

This commit is contained in:
Zhihai Liao
2023-07-01 22:56:58 +00:00
parent b5a20ee96a
commit b9bb677cd0

View File

@@ -1,4 +1,3 @@
from time import sleep
from rsshub.utils import DEFAULT_HEADERS, fetch
@@ -6,10 +5,10 @@ def parse_html(post):
item = {}
item['title'] = post.xpath('text()').extract_first()
item['link'] = post.xpath('@href').extract_first()
html = fetch(item['link'], headers=DEFAULT_HEADERS)
print(item['link'])
item['description'] = (
html
.xpath('//div[@id="detail"]')
fetch(item['link'], headers=DEFAULT_HEADERS)
.xpath('//div[@id=\'detail\']')
.get()
)
return item
return item