登录失败, 账号密码失败进行截图

This commit is contained in:
Your Name
2025-11-06 23:49:56 +08:00
parent 6ab0f95a82
commit 1020408f3b

View File

@@ -978,7 +978,7 @@ def playwright_m_login(username, password, code_2fa=None):
failed_login = page.query_selector(failed_login_selector)
if failed_login:
# 登录失败, 返回失败信息
page.screenshot(path=f'./log/screenshot/{username}_{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())}_login_failed.png')
page.screenshot(path=f'./log/screenshot/{username}_{time.strftime("%Y-%m-%d%H-%M-%S", time.localtime())}_login_failed.png')
logger.info(f"用户名:{username} 密码错误 {failed_login.text_content()}")
raise OperationFailed(failed_login.text_content())
@@ -1138,7 +1138,7 @@ if __name__ == '__main__':
# # # 视频链接的帖子点赞
# print(playwright_like(cookies, "https://www.facebook.com/groups/1070754870427928/permalink/1873461830157224/"))
#
cookies = playwright_m_login('61583069571290', '47lfsryRmI', 'IJ6YM5MX6HEMRRIDSNUMSCEBJEIHVH3R')
cookies = playwright_m_login('61583069571290', '47lfsr123yRmI', 'IJ6YM5MX6HEMRRIDSNUMSCEBJEIHVH3R')
print(cookies)
# pass