add resulting url
Build and Push Docker Images / build-and-push (push) Successful in 1m24s

This commit is contained in:
2026-04-29 15:47:10 +02:00
parent 6ada34a8c8
commit a93bca3c73
25 changed files with 21 additions and 4 deletions
+10 -1
View File
@@ -183,7 +183,7 @@ async def interactions_service(
scroll_x: int | None = None,
scroll_y: int | None = None,
):
"""Open `decoded_url`, execute click/type interactions in order, then return screenshot or HTML."""
"""Open `decoded_url`, execute click/type interactions in order, then return screenshot, HTML, or resulting_url."""
print(f"Running interactions on {decoded_url} (return_type={return_type})")
async def interactions_operation(page):
@@ -392,6 +392,15 @@ async def interactions_service(
except Exception:
pass
if return_type == "resulting_url":
final_url = unquote(page.url or "")
return {
"status": "success",
"original_url": decoded_url,
"resulting_url": final_url,
"redirected": final_url != decoded_url,
}
if return_type == "html":
return await page.content()