From 8c30f4c6a6b85c0c45b6a3ba20c4625dd3ff9ff9 Mon Sep 17 00:00:00 2001 From: zzzzzy2k <58884549+zzzzzy2k@users.noreply.github.com> Date: Sun, 3 May 2026 14:03:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B0=8F=E7=BA=A2?= =?UTF-8?q?=E4=B9=A6=E4=B8=8A=E4=BC=A0=E5=8F=AA=E6=9C=89=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uploader/xiaohongshu_uploader/main.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/uploader/xiaohongshu_uploader/main.py b/uploader/xiaohongshu_uploader/main.py index b069b54..7ae0e8e 100644 --- a/uploader/xiaohongshu_uploader/main.py +++ b/uploader/xiaohongshu_uploader/main.py @@ -399,14 +399,15 @@ class XiaoHongShuBaseUploader(BaseVideoUploader): desc = page.locator('p[data-placeholder*="输入正文描述"]') await desc.click() - await page.keyboard.type("#" + self.tags[0], delay=30) - await page.locator('#creator-editor-topic-container').wait_for( - state="visible", - timeout=3000 - ) - first_item = page.locator('#creator-editor-topic-container .item').first - await first_item.wait_for(state="visible", timeout=2000) - await first_item.click() + for tag in self.tags: # 循环处理所有 tags + await page.keyboard.type("#" + tag, delay=30) + await page.locator('#creator-editor-topic-container').wait_for( + state="visible", + timeout=3000 + ) + first_item = page.locator('#creator-editor-topic-container .item').first + await first_item.wait_for(state="visible", timeout=2000) + await first_item.click() async def fill_meta(self, page: Page) -> None: await self.fill_title(page)