browser_handle_dialog
Browser Handle Dialog
Manually accept or dismiss a specific dialog by its ID. Use for interactive dialog handling instead of automatic actions. For prompt dialogs, can provide response text when accepting.
Usage Example
123456789101112
import asyncio
from owl_browser import OwlBrowser, RemoteConfig
# Async usage
async with OwlBrowser(config) as browser:
context = await browser.create_context()
context_id = context["context_id"]
await browser.handle_dialog(
dialog_id="value",
accept=True
)
Parameters
Required
dialog_idstringrequiredThe unique identifier of the dialog to handle, obtained from browser_get_pending_dialog or browser_wait_for_dialog
acceptbooleanrequiredSet to true to accept (click OK/Yes) or false to dismiss (click Cancel/No) the dialog
Optional
response_textstringText to enter in prompt dialogs before accepting. Only applicable for prompt dialogs when accept=true. Ignored for alert and confirm dialogs
Response
Returns a JSON object with the operation result.
{
"success": true,
"result": <value>
}