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)