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: