From 3530c000f56a6b5d9bf1cbc47c55998bc952f03f Mon Sep 17 00:00:00 2001 From: work Date: Fri, 17 Oct 2025 11:46:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=84=E8=AE=BA=E6=89=BE?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E6=8C=89=E9=92=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spider/task.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spider/task.py b/spider/task.py index 136527e..2199942 100644 --- a/spider/task.py +++ b/spider/task.py @@ -490,7 +490,7 @@ 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[@data-ad-rendering-role="comment_button"]' + input_xpath = '//div[@role="dialog"]//span[text()="Comment" or@data-ad-rendering-role="comment_button"]' attach_xpath = '//div[@id="focused-state-actions-list"]//div[@aria-label="Attach a photo or video"]' comment_xpath = '//div[@aria-label="Comment"]' page.click(input_xpath)