mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
parent
d547b9d24a
commit
f5d388af7d
13
docs/api.md
13
docs/api.md
@ -2035,6 +2035,19 @@ Dispatches a `keyup` event.
|
||||
|
||||
The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
|
||||
|
||||
Every `page` object has it's own Mouse, accessible with [`page.mouse`](#pagemouse).
|
||||
|
||||
```js
|
||||
// Using ‘page.mouse’ to trace a 100x100 square.
|
||||
await page.mouse.move(0, 0);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(0, 100);
|
||||
await page.mouse.move(100, 100);
|
||||
await page.mouse.move(100, 0);
|
||||
await page.mouse.move(0, 0);
|
||||
await page.mouse.up();
|
||||
```
|
||||
|
||||
#### mouse.click(x, y, [options])
|
||||
- `x` <[number]>
|
||||
- `y` <[number]>
|
||||
|
Loading…
Reference in New Issue
Block a user