-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed file which was accidentally created
+ added mouse_drag_boxes.py to examples
- Loading branch information
1 parent
2a6eb78
commit 57cb72b
Showing
2 changed files
with
70 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
|
||
from nodriver import * | ||
|
||
|
||
async def main(): | ||
browser = await start() | ||
await demo_drag_to_target(browser) | ||
await demo_drag_to_target_in_steps(browser) | ||
await demo_drag_to_absolute_position(browser) | ||
await demo_drag_to_absolute_position_in_steps(browser) | ||
await demo_drag_to_relative_position(browser) | ||
await demo_drag_to_relative_position_in_steps(browser) | ||
|
||
|
||
async def demo_drag_to_target(browser): | ||
tab = await browser.get('https://nowsecure.nl/mouse.html?boxes=50') | ||
boxes = await tab.select_all('.box') | ||
area = await tab.select('.area-a') | ||
for box in boxes: | ||
await box.mouse_drag(area) | ||
|
||
|
||
async def demo_drag_to_target_in_steps(browser): | ||
|
||
tab = await browser.get('https://nowsecure.nl/mouse.html') | ||
boxes = await tab.select_all('.box') | ||
area = await tab.select('.area-a') | ||
|
||
for box in boxes: | ||
await box.mouse_drag(area, steps=100) | ||
|
||
|
||
async def demo_drag_to_absolute_position(browser): | ||
tab = await browser.get('https://nowsecure.nl/mouse.html?boxes=50') | ||
boxes = await tab.select_all('.box') | ||
area = await tab.select('.area-a') | ||
|
||
for box in boxes: | ||
await box.mouse_drag((500, 500)) | ||
|
||
|
||
async def demo_drag_to_absolute_position_in_steps(browser): | ||
tab = await browser.get('https://nowsecure.nl/mouse.html') | ||
boxes = await tab.select_all('.box') | ||
area = await tab.select('.area-a') | ||
|
||
for box in boxes: | ||
await box.mouse_drag((500, 500), steps=50) | ||
|
||
|
||
async def demo_drag_to_relative_position(browser): | ||
tab = await browser.get('https://nowsecure.nl/mouse.html?boxes=50') | ||
boxes = await tab.select_all('.box') | ||
|
||
for box in boxes: | ||
await box.mouse_drag((500, 500), relative=True) | ||
|
||
|
||
async def demo_drag_to_relative_position_in_steps(browser): | ||
tab = await browser.get('https://nowsecure.nl/mouse.html') | ||
boxes = await tab.select_all('.box') | ||
|
||
for box in boxes: | ||
await box.mouse_drag((500, 500), relative=True, steps=50) | ||
|
||
|
||
|
||
|
||
if __name__ == '__main__': | ||
loop().run_until_complete(main()) |
This file was deleted.
Oops, something went wrong.