anthropic CUA - support double and triple clicks (#2264)

This commit is contained in:
Shuchang Zheng
2025-05-01 07:30:16 +08:00
committed by GitHub
parent e1feb6cb45
commit 7dae328c0c
3 changed files with 19 additions and 2 deletions

View File

@@ -505,7 +505,15 @@ async def handle_click_action(
)
LOG.info("Clicked element at location", x=action.x, y=action.y, element_id=element_id, button=action.button)
await page.mouse.click(x=action.x, y=action.y, button=action.button)
if action.repeat == 1:
await page.mouse.click(x=action.x, y=action.y, button=action.button)
elif action.repeat == 2:
await page.mouse.dblclick(x=action.x, y=action.y, button=action.button)
elif action.repeat == 3:
await page.mouse.click(x=action.x, y=action.y, button=action.button, click_count=3)
else:
raise ValueError(f"Invalid repeat value: {action.repeat}")
return [ActionSuccess()]
dom = DomUtil(scraped_page=scraped_page, page=page)