mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
优化标题获取
This commit is contained in:
@@ -122,6 +122,10 @@ def get_title(markup):
|
||||
if h2:
|
||||
return h2.text.strip()
|
||||
|
||||
h3 = soup.h3
|
||||
if h2:
|
||||
return h3.text.strip()
|
||||
|
||||
desc = soup.find('meta', attrs={'name': 'description'})
|
||||
if desc:
|
||||
return desc['content'].strip()
|
||||
|
||||
Reference in New Issue
Block a user