Hi Team,
plw 1.8.0
with headless: false code works fine, but with headless: true only first element is downloaded.
plw 1.3.0
works fine with both params (headless: false & headless: true)
What could be a problem with 1.8.0?
tnx a lot
const playwright = require("playwright");
(async () => {
const browser = await playwright.chromium.launch({ headless: false });
const context = await browser.newContext({
acceptDownloads: true,
});
const page = await context.newPage();
await page.goto(
"https://file-examples.com/index.php/sample-documents-download/sample-xls-download/"
);
const handles = await page.$$("#table-files .file-link");
for (let num of handles) {
const [download] = await Promise.all([
page.waitForEvent("download"), // wait for download to start
(await num.$("a.btn")).click(),
]);
const path = await download.path();
console.log(path);
}
await browser.close();
})();
Hi Team,
plw 1.8.0
with headless: false code works fine, but with headless: true only first element is downloaded.
plw 1.3.0
works fine with both params (headless: false & headless: true)
What could be a problem with 1.8.0?
tnx a lot