Function
aexecute_scroll
(direction: str, page: APage)
Source from the content-addressed store, hash-verified
| 936 | |
| 937 | |
| 938 | async def aexecute_scroll(direction: str, page: APage) -> None: |
| 939 | # perform the action |
| 940 | # code from natbot |
| 941 | if direction == "up": |
| 942 | await page.evaluate( |
| 943 | "(document.scrollingElement || document.body).scrollTop = (document.scrollingElement || document.body).scrollTop - window.innerHeight;" |
| 944 | ) |
| 945 | elif direction == "down": |
| 946 | await page.evaluate( |
| 947 | "(document.scrollingElement || document.body).scrollTop = (document.scrollingElement || document.body).scrollTop + window.innerHeight;" |
| 948 | ) |
| 949 | |
| 950 | |
| 951 | def execute_key_press(key: str, page: Page) -> None: |
Tested by
no test coverage detected