MCPcopy
hub / github.com/nat/natbot / scroll

Method scroll

natbot.py:181–189  ·  view source on GitHub ↗
(self, direction)

Source from the content-addressed store, hash-verified

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

Callers 2

run_cmdFunction · 0.80
natbot.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected