Facebook发帖输入内容更改为fill

This commit is contained in:
Your Name
2026-03-03 11:18:06 +08:00
parent dd0f98ee5a
commit 854c51cae1

View File

@@ -490,7 +490,8 @@ def playwright_post(cookies, content, image_key=None):
if not image_key:
page.click('''//span[contains(text(), "What's on your mind")]''')
_edit_privacy(page)
page.type('''//div[contains(@aria-placeholder, "What's on your mind")]''', content, delay=50,
# 修改后 (使用 fill)
page.fill('//div[contains(@aria-placeholder, "What\'s on your mind")]', content,
timeout=300000)
page.click('//div[@aria-label="Post"]', timeout=300000)
time.sleep(15)