Skip to content

Commit

Permalink
🫡 Add timeout to capture download
Browse files Browse the repository at this point in the history
  • Loading branch information
awtkns committed Jan 21, 2025
1 parent 8566526 commit 9c0aa59
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "harambe-core"
version = "0.59.3"
version = "0.59.4"
description = "Core types for harambe SDK 🐒🍌"
authors = [
{ name = "Adam Watkins", email = "[email protected]" }
Expand Down
3 changes: 2 additions & 1 deletion sdk/harambe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,14 @@ async def capture_download(
clickable: ElementHandle,
override_filename: str | None = None,
override_url: str | None = None,
timeout: float | None = None,
) -> DownloadMeta:
"""
Capture the download of a click event. This will click the element, download the resulting file
and apply some download handling logic from the observer to transform to a usable URL
"""

async with self.page.expect_download() as download_info:
async with self.page.expect_download(timeout=timeout) as download_info:
await clickable.click()
download = await download_info.value

Expand Down
4 changes: 2 additions & 2 deletions sdk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[project]
name = "harambe-sdk"
version = "0.59.3"
version = "0.59.4"
description = "Data extraction SDK for Playwright 🐒🍌"
authors = [
{ name = "Adam Watkins", email = "[email protected]" }
]
requires-python = ">=3.11,<4.0"
readme = "README.md"
dependencies = [
"harambe_core==0.59.3",
"harambe_core==0.59.4",
"playwright==1.47.0",
"beautifulsoup4==4.12.3",
"requests==2.32.3",
Expand Down

0 comments on commit 9c0aa59

Please sign in to comment.