docs(java): add missing download example (#8128)

This commit is contained in:
Yury Semikhatsky 2021-08-10 21:23:57 -07:00 committed by GitHub
parent 21b510c6e7
commit 78f24ec693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,16 @@ const [ download ] = await Promise.all([
const path = await download.path();
```
```java
// Wait for the download to start
Download download = page.waitForDownload(() -> {
// Perform the action that initiates download
page.click("button#delayed-download");
});
// Wait for the download process to complete
Path path = download.path();
```
```python async
# Start waiting for the download
async with page.expect_download() as download_info: