Version: 1.8.0
Mouse
The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
Every page
object has its own Mouse, accessible with page.mouse.
- Sync
- Async
- mouse.click(x, y, **kwargs)
- mouse.dblclick(x, y, **kwargs)
- mouse.down(**kwargs)
- mouse.move(x, y, **kwargs)
- mouse.up(**kwargs)
#
mouse.click(x, y, **kwargs)x
<float>y
<float>button
<"left"|"right"|"middle"> Defaults toleft
.click_count
<int> defaults to 1. See UIEvent.detail.delay
<float> Time to wait betweenmousedown
andmouseup
in milliseconds. Defaults to 0.
Shortcut for mouse.move(x, y, **kwargs), mouse.down(**kwargs), mouse.up(**kwargs).
#
mouse.dblclick(x, y, **kwargs)x
<float>y
<float>button
<"left"|"right"|"middle"> Defaults toleft
.delay
<float> Time to wait betweenmousedown
andmouseup
in milliseconds. Defaults to 0.
Shortcut for mouse.move(x, y, **kwargs), mouse.down(**kwargs), mouse.up(**kwargs), mouse.down(**kwargs) and mouse.up(**kwargs).
#
mouse.down(**kwargs)button
<"left"|"right"|"middle"> Defaults toleft
.click_count
<int> defaults to 1. See UIEvent.detail.
Dispatches a mousedown
event.
#
mouse.move(x, y, **kwargs)Dispatches a mousemove
event.
#
mouse.up(**kwargs)button
<"left"|"right"|"middle"> Defaults toleft
.click_count
<int> defaults to 1. See UIEvent.detail.
Dispatches a mouseup
event.