fix(lxml): Adjust HTML element checks to prevent FutureWarning

This commit is contained in:
InfinityPacer
2024-08-31 02:14:52 +08:00
parent 9ab852c1ad
commit 93801e857e
13 changed files with 35 additions and 23 deletions
+1 -1
View File
@@ -363,7 +363,7 @@ class RssHelper:
return "", f"获取RSS链接失败:无法连接 {url} "
# 解析HTML
html = etree.HTML(html_text)
if html:
if StringUtils.is_valid_html_element(html):
rss_link = html.xpath(site_conf.get("xpath"))
if rss_link:
return str(rss_link[-1]), ""