From c645d7e8a6039ef4527784d26e69a577bce0f3b8 Mon Sep 17 00:00:00 2001 From: Chasays Date: Thu, 5 Feb 2026 20:51:26 +0800 Subject: [PATCH] update user desc update user desc --- src/automation/keywordFollow.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/automation/keywordFollow.js b/src/automation/keywordFollow.js index e89c40c..1be30a8 100644 --- a/src/automation/keywordFollow.js +++ b/src/automation/keywordFollow.js @@ -73,6 +73,13 @@ await sleep(1000); }; + const getBioFromUserCell = (cell) => { + // bio 通常是 dir="auto" 且带 overflow hidden(简介会截断) + const bioDiv = [...cell.querySelectorAll('div[dir="auto"]')] + .find(d => (d.getAttribute('style') || '').includes('overflow: hidden')); + return (bioDiv?.textContent || '').trim(); + }; + // ============================================ // USER EXTRACTION // ============================================ @@ -85,7 +92,7 @@ const displayName = nameEl?.textContent || username; const bioEl = userCell.querySelector('[data-testid="UserDescription"]'); - const bio = bioEl?.textContent || ''; + const bio = bioEl?.textContent || getBioFromUserCell(userCell); // Try to get follower count (might not always be visible) const statsText = userCell.textContent || '';