This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user