download the file and save as specified filename
For example, I want to download the pdf file https://www.okcc.online/document.php?s=2y08wAM0TAlm2JACdE1Odb9keuvnLvSujwEnJ3bFigVrINRJoRV8HKR2&d=DOCCD-1910221606-MTG&t=rod and save as 1910221606.pdf
I have built this function as myself but it only saves as original file name like "Unofficial Document.pdf"
const localFilePath =
./${instrumentNumber}.pdf; const pdfURL =
https://www.okcc.online${iframeSrc};await page.evaluate(
(link, localFilePath) => {
const a = document.createElement("a");
a.href = link;
a.download = localFilePath;
a.style.display = "none";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
},
pdfURL,
localFilePath
);
