| 179 | self.page_element_buffer = {} |
| 180 | |
| 181 | def scroll(self, direction): |
| 182 | if direction == "up": |
| 183 | self.page.evaluate( |
| 184 | "(document.scrollingElement || document.body).scrollTop = (document.scrollingElement || document.body).scrollTop - window.innerHeight;" |
| 185 | ) |
| 186 | elif direction == "down": |
| 187 | self.page.evaluate( |
| 188 | "(document.scrollingElement || document.body).scrollTop = (document.scrollingElement || document.body).scrollTop + window.innerHeight;" |
| 189 | ) |
| 190 | |
| 191 | def click(self, id): |
| 192 | # Inject javascript into the page which removes the target= attribute from all links |