fix: баги
This commit is contained in:
1 parent
ec2dca2529
commit
7b85b99ba4
2 files changed
+4
-2
No files matched your search
@@ -44,4 +44,6 @@ async def execute(page: Page, actions: list[ActionRequest]) -> list[str]:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
actions_result.append({"type": act.type, "ok": "false", "error": str(e)})
|
actions_result.append({"type": act.type, "ok": "false", "error": str(e)})
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
actions_result.append({"type": act.type, "ok": "true"})
|
||||||
return actions_result
|
return actions_result
|
||||||
+2
-2
@@ -38,7 +38,7 @@ async def solve(request: Request, payload: SolveRequest):
|
|||||||
actions_result = await actions.execute(page, payload.actions)
|
actions_result = await actions.execute(page, payload.actions)
|
||||||
status = not "error" in actions_result[-1]
|
status = not "error" in actions_result[-1]
|
||||||
error = ["Something error", None][status]
|
error = ["Something error", None][status]
|
||||||
cookies = await camoufo.cookies()
|
# cookies = await camoufo.cookies()
|
||||||
html = await page.inner_html('html')
|
html = await page.inner_html('html')
|
||||||
await page.screenshot(
|
await page.screenshot(
|
||||||
path=(
|
path=(
|
||||||
@@ -49,7 +49,7 @@ async def solve(request: Request, payload: SolveRequest):
|
|||||||
return {
|
return {
|
||||||
"status": ["err", "ok"][status],
|
"status": ["err", "ok"][status],
|
||||||
"html": html,
|
"html": html,
|
||||||
"cookies": cookies,
|
# "cookies": cookies,
|
||||||
"actions": actions_result,
|
"actions": actions_result,
|
||||||
"error": error,
|
"error": error,
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user