mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-18 15:09:34 +00:00
16 lines
405 B
Python
16 lines
405 B
Python
from time import sleep
|
|
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()
|
|
html = fetch(item['link'], headers=DEFAULT_HEADERS)
|
|
item['description'] = (
|
|
html
|
|
.xpath('//div[@id="detail"]')
|
|
.get()
|
|
)
|
|
sleep(1)
|
|
return item |