Skip to content

Commit b6ac8ba

Browse files
authored
add close function to page (#34)
1 parent 3af6641 commit b6ac8ba

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

dendrite_sdk/_core/dendrite_page.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,21 @@ async def scroll_to_bottom(self, timeout: float = 30000) -> None:
169169

170170
last_scroll_position = current_scroll_position
171171

172-
await asyncio.sleep(0.1)
172+
# # Check if the timeout has been exceeded
173+
# if time.time() - start_time > timeout * 0.001:
174+
# logger.debug("Timeout exceeded. Stopping scrolling.")
175+
# break
176+
177+
logger.debug("Done scrolling to the bottom of the page.")
178+
179+
async def close(self) -> None:
180+
"""
181+
Closes the current page.
182+
183+
Returns:
184+
None
185+
"""
186+
await self.playwright_page.close()
173187

174188
async def _get_page_information(self) -> PageInformation:
175189
"""

0 commit comments

Comments
 (0)