我在服务器上创建了一个csv文件。然后我想点击一个按钮下载。手动操作效果良好。但如果我点击Playwright的下载按钮。怎么做才是正确的方法。
Thnak你的帮助
剧作家文档中有这个。请做家庭作业。
const [ download ] = await Promise.all([
// Start waiting for the download
page.waitForEvent('download'),
// Perform the action that initiates download
page.click('button#delayed-download')
]);
// Wait for the download process to complete
const path = await download.path();
如前所述,请参阅playwright.dev/docs/downloads