修复视频发帖

This commit is contained in:
Your Name
2026-02-06 20:56:12 +08:00
parent 06d59db0a7
commit 083a22643c

View File

@@ -384,10 +384,10 @@ def retry_get_new_video(page, cookies, post_count):
try: try:
# 尝试点击视频 # 尝试点击视频
comment_buttons = page.query_selector_all( comment_buttons = page.query_selector_all(
'//div[@aria-label="Video player"]') '//div[@aria-label="Leave a comment"]')
if comment_buttons: if comment_buttons:
# 使用js去点击第一个评论按钮 # 使用js去点击第一个评论按钮
element = page.query_selector_all('//div[@aria-label="Video player"]')[0] element = page.query_selector_all('//div[@aria-label="Leave a comment"]')[0]
page.evaluate('(element) => element.click()', element) page.evaluate('(element) => element.click()', element)
time.sleep(random.randint(3, 5)) time.sleep(random.randint(3, 5))
page.reload() page.reload()