|
|
Any | _sync (self, Union[Coroutine[Any, Any, Any], Generator[Any, Any, Any]] coro) |
| |
|
Callable[..., None] | _wrap_handler (self, Union[Callable[..., Any], Any] handler) |
| |
|
| _dispatcher_fiber |
| |
|
| _loop |
| |
|
| _impl_obj |
| |
◆ cancel()
| None playwright.sync_api._generated.Download.cancel |
( |
|
self | ) |
|
Download.cancel
Cancels a download. Will not fail if the download is already finished or canceled. Upon successful cancellations,
`download.failure()` would resolve to `'canceled'`.
◆ delete()
| None playwright.sync_api._generated.Download.delete |
( |
|
self | ) |
|
Download.delete
Deletes the downloaded file. Will wait for the download to finish if necessary.
◆ failure()
| typing.Optional[str] playwright.sync_api._generated.Download.failure |
( |
|
self | ) |
|
Download.failure
Returns download error if any. Will wait for the download to finish if necessary.
Returns
-------
Union[str, None]
◆ page()
| "Page" playwright.sync_api._generated.Download.page |
( |
|
self | ) |
|
Download.page
Get the page that the download belongs to.
Returns
-------
Page
◆ path()
| pathlib.Path playwright.sync_api._generated.Download.path |
( |
|
self | ) |
|
Download.path
Returns path to the downloaded file for a successful download, or throws for a failed/canceled download. The method
will wait for the download to finish if necessary. The method throws when connected remotely.
Note that the download's file name is a random GUID, use `download.suggested_filename()` to get suggested
file name.
Returns
-------
pathlib.Path
◆ save_as()
| None playwright.sync_api._generated.Download.save_as |
( |
|
self, |
|
|
typing.Union[str, pathlib.Path] |
path |
|
) |
| |
Download.save_as
Copy the download to a user-specified path. It is safe to call this method while the download is still in progress.
Will wait for the download to finish if necessary.
**Usage**
```py
download.save_as(\"/path/to/save/at/\" + download.suggested_filename)
```
Parameters
----------
path : Union[pathlib.Path, str]
Path where the download should be copied.
◆ suggested_filename()
| str playwright.sync_api._generated.Download.suggested_filename |
( |
|
self | ) |
|
Download.suggested_filename
Returns suggested filename for this download. It is typically computed by the browser from the
[`Content-Disposition`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) response
header or the `download` attribute. See the spec on [whatwg](https://html.spec.whatwg.org/#downloading-resources).
Different browsers can use different logic for computing it.
Returns
-------
str
◆ url()
| str playwright.sync_api._generated.Download.url |
( |
|
self | ) |
|
Download.url
Returns downloaded url.
Returns
-------
str
The documentation for this class was generated from the following file:
- docs/help/help-venv/lib/python3.12/site-packages/playwright/sync_api/_generated.py