feat: url текущей страницы в ответе задачи (#116)
SPA меняет адрес без навигации (страница созданной заявки и т.п.): ответ v1/v2 отдаёт page.url после действий, клиент 0.2.1 - Result.url. Документация и unit-тесты. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
95b5057d9f
commit
f21483489a
9 files changed
+14
-2
No files matched your search
@@ -138,6 +138,8 @@ def make_page_action(payload: TaskRequest):
|
||||
"html": await page.inner_html("html"),
|
||||
"screenshot": screenshot,
|
||||
"user_agent": await page.evaluate("() => navigator.userAgent"),
|
||||
# адрес страницы после действий: SPA меняет его без навигации (номер заявки и т.п.)
|
||||
"url": page.url,
|
||||
}
|
||||
|
||||
return page_action
|
||||
@@ -149,6 +151,7 @@ def build_result(payload: TaskRequest, result: dict) -> dict:
|
||||
response = {
|
||||
"status": "ok",
|
||||
"user_agent": result["user_agent"],
|
||||
"url": result.get("url"),
|
||||
"cookies": result["cookies"],
|
||||
"actions": result["actions"],
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user