MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / scroll_up

Method scroll_up

seleniumbase/core/sb_cdp.py:3477–3484  ·  view source on GitHub ↗

Scrolls up as a percentage of the page.

(self, amount=25)

Source from the content-addressed store, hash-verified

3475 self.loop.run_until_complete(self.page.wait(0.1))
3476
3477 def scroll_up(self, amount=25):
3478 """Scrolls up as a percentage of the page."""
3479 try:
3480 self.loop.run_until_complete(self.page.scroll_up(amount))
3481 except Exception:
3482 amount = self.get_window_size()["height"] * amount / 100
3483 self.execute_script("window.scrollBy(0, -%s);" % amount)
3484 self.loop.run_until_complete(self.page.wait(0.1))
3485
3486 def scroll_down(self, amount=25):
3487 """Scrolls down as a percentage of the page."""

Callers

nothing calls this directly

Calls 3

get_window_sizeMethod · 0.95
execute_scriptMethod · 0.95
waitMethod · 0.45

Tested by

no test coverage detected