更新公司介绍提取逻辑,增加对新XPath路径的支持

This commit is contained in:
晓丰 2025-05-25 23:26:38 +08:00
parent 688e7fb3f7
commit 05591129b9

View File

@ -13,6 +13,9 @@ def extract_company_data(xpathobj):
intro_list = [t.strip() for t in xpathobj.xpath('//div[@class="company_img_auto"]/p/text()') if t.strip()]
if not intro_list:
intro_list = [t.strip() for t in xpathobj.xpath('//div[@class="company_img_auto"]/text()') if t.strip()]
if not intro_list:
intro_list = [t.strip() for t in xpathobj.xpath('//div[@class="company_img_auto"]/p/span/text()') if t.strip()]
introduction = "\r\n".join(intro_list)
# 如果没有名称或介绍,直接忽略