Browse Source

fix: 精准筛选标签名

wuwenyi 8 months ago
parent
commit
ae2788c771
1 changed files with 1 additions and 1 deletions
  1. 1 1
      huitun/__init__.py

+ 1 - 1
huitun/__init__.py

@@ -45,7 +45,7 @@ class HuiTunBrowser(BaseBrowser):
             self.page.goto('https://xhs.huitun.com/#/note/note_search')
             # 展开全部标签
             self.page.query_selector('.RaWdmGo9iaS1-bQ6mK5K4w\=\=').click()
-            self.page.get_by_text(tag_name, exact=True).click()
+            self.page.query_selector(f'.IRk6XOEYweiS9APLHrOp-w\=\=:has-text("{tag_name}")').click()
             self.page.get_by_text('图文笔记', exact=True).click()
             self.page.wait_for_timeout(500)
             self.page.on('response', self.search_note_handler)