fix(card): 修复cgc卡不存在抛异常

This commit is contained in:
xingc
2025-04-25 17:41:59 +08:00
parent 0f21491ec2
commit eec6b00685
2 changed files with 28 additions and 1 deletions

View File

@@ -279,7 +279,7 @@ class CardScraper:
"""CGC"""
r = await self.api.cgc(cert_number)
html = Selector(r.text)
if html.xpath('//div[@class="error" and @ng-show]').get() is None:
if html.xpath('//div[@class="certlookup-search-box"]').get() is None:
return
info_elements = html.xpath('//div[@class="content-wrapper"]//dl')