From 3682f73ae7044a2a8ea270f9a7ca41b070f9b01b Mon Sep 17 00:00:00 2001 From: work Date: Thu, 9 Apr 2026 09:37:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spider/task.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spider/task.py b/spider/task.py index cc113ee..c837e05 100644 --- a/spider/task.py +++ b/spider/task.py @@ -629,9 +629,9 @@ def playwright_comment(cookies, target_url, content, image_key=None): if 'permalink.php?story_fbid' in target_url or '/posts/' in target_url or "/permalink/" in target_url: # 文字或图片类型 - input_xpath = '//div[@role="dialog"]//span[text()="Comment" or@data-ad-rendering-role="comment_button"]' + input_xpath = '//div[@role="dialog"]//span[text()="Comment" or @data-ad-rendering-role="comment_button"] | //div[@role="dialog"]//div[@aria-label="Write a comment…" and @role="textbox" and @contenteditable="true"]' attach_xpath = '//div[@id="focused-state-actions-list"]//div[@aria-label="Attach a photo or video"]' - comment_xpath = '//div[@id="focused-state-composer-submit"]' + comment_xpath = '//div[@aria-label="Comment"] | //div[@id="focused-state-composer-submit"] | //div[@aria-label="Post comment" and @role="button"]' page.click(input_xpath) sleep(1, 2) elif 'watch/?v' in target_url or '/videos/' in target_url: