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)