| 193 | self.page_element_buffer = {} |
| 194 | |
| 195 | def scroll(self, direction): |
| 196 | if direction == "up": |
| 197 | self.page.evaluate( |
| 198 | "(document.scrollingElement || document.body).scrollTop = (document.scrollingElement || document.body).scrollTop - window.innerHeight;" |
| 199 | ) |
| 200 | elif direction == "down": |
| 201 | self.page.evaluate( |
| 202 | "(document.scrollingElement || document.body).scrollTop = (document.scrollingElement || document.body).scrollTop + window.innerHeight;" |
| 203 | ) |
| 204 | |
| 205 | def click(self, id): |
| 206 | # Inject javascript into the page which removes the target= attribute from all links |