You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steve has provided a script that can be run via browser devtools that will auto-download your stockplan confirmations.
Most browsers have devtools bound to F12 but are also available via menus.
Go to the etrade stock confirmations page, select a year, paste in the following into the dev tools console tab.
// Function to download a file given a URL
const downloadFile = async (url) => {
try {
const response = await fetch(url);
const blob = await response.blob();
const fileName = url.substring(url.lastIndexOf('/') + 1).replace(/\?.*/, ''); // Extract filename from URL and remove query string
const a = document.createElement('a');
a.href = window.URL.createObjectURL(blob);
a.download = fileName.endsWith('.pdf') ? fileName : `${fileName}.pdf`; // Ensure file extension is ".pdf"
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
await new Promise((resolve) => setTimeout(resolve, 1000)); // Delay for 1 second
} catch (error) {
console.error('Error downloading file:', error);
}
};
// Function to check if a link is a PDF download link
const isPDFLink = (link) => {
return link.href && link.href.includes('/webapisp/stockplan/pdf/get');
};
// Iterate through all links on the page and download PDF files
document.querySelectorAll('a').forEach((link) => {
if (isPDFLink(link)) {
downloadFile(link.href);
}
});
I've not tried this myself yet.
The text was updated successfully, but these errors were encountered:
Steve has provided a script that can be run via browser devtools that will auto-download your stockplan confirmations.
Most browsers have devtools bound to F12 but are also available via menus.
Go to the etrade stock confirmations page, select a year, paste in the following into the dev tools console tab.
I've not tried this myself yet.
The text was updated successfully, but these errors were encountered: