diff --git a/dendrite/__init__.py b/dendrite/__init__.py index d2c6c4d..931c728 100644 --- a/dendrite/__init__.py +++ b/dendrite/__init__.py @@ -18,7 +18,7 @@ fmt = "{time: HH:mm:ss.SSS} | {level: <8}- {message}" -logger.add(sys.stderr, level="DEBUG", format=fmt) +logger.add(sys.stderr, level="INFO", format=fmt) __all__ = [ diff --git a/dendrite/async_api/_core/dendrite_browser.py b/dendrite/async_api/_core/dendrite_browser.py index 2b4418a..07722ee 100644 --- a/dendrite/async_api/_core/dendrite_browser.py +++ b/dendrite/async_api/_core/dendrite_browser.py @@ -259,6 +259,25 @@ async def goto( return active_page + async def scroll_to_bottom( + self, + timeout: float = 30000, + scroll_increment: int = 1000, + no_progress_limit: int = 3, + ): + """ + Scrolls to the bottom of the current page. + + Returns: + None + """ + active_page = await self.get_active_page() + await active_page.scroll_to_bottom( + timeout=timeout, + scroll_increment=scroll_increment, + no_progress_limit=no_progress_limit, + ) + async def _launch(self): """ Launches the Playwright instance and sets up the browser context and page manager. diff --git a/dendrite/sync_api/_core/dendrite_browser.py b/dendrite/sync_api/_core/dendrite_browser.py index 351fa56..259841e 100644 --- a/dendrite/sync_api/_core/dendrite_browser.py +++ b/dendrite/sync_api/_core/dendrite_browser.py @@ -234,6 +234,25 @@ def goto( raise IncorrectOutcomeError(f"Incorrect navigation, reason: {e}") return active_page + def scroll_to_bottom( + self, + timeout: float = 30000, + scroll_increment: int = 1000, + no_progress_limit: int = 3, + ): + """ + Scrolls to the bottom of the current page. + + Returns: + None + """ + active_page = self.get_active_page() + active_page.scroll_to_bottom( + timeout=timeout, + scroll_increment=scroll_increment, + no_progress_limit=no_progress_limit, + ) + def _launch(self): """ Launches the Playwright instance and sets up the browser context and page manager.