diff --git a/spider/task.py b/spider/task.py index 20f9e21..44402e0 100644 --- a/spider/task.py +++ b/spider/task.py @@ -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)