Skip to content

Instantly share code, notes, and snippets.

@william-reed
Created March 2, 2022 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save william-reed/b0687cb91a2e69c920c1d737eb68fc36 to your computer and use it in GitHub Desktop.
Save william-reed/b0687cb91a2e69c920c1d737eb68fc36 to your computer and use it in GitHub Desktop.
erwin.vw.com download all documents
// once you have a one day plan:
// 1. navigate to your vehicles page under 'Service Information'
// 2. Leave 'Category 1' set to '[Category 1]' and click search
// 3. Open your JS console
// get all document titles
titles = document.getElementsByClassName("title")
documentIds = []
// extract each document id
for (let title of titles) {
documentIds.push(title.href.split("=")[1])
}
// function to download target URL
function download(url, filename) {
fetch(url).then(function(t) {
return t.blob().then((b)=>{
var a = document.createElement("a");
a.href = URL.createObjectURL(b);
a.setAttribute("download", filename);
a.click();
}
);
});
}
// download them all
documentIds.forEach { docId =>
download("https://erwin.vw.com/erwin/onlineview.sealed?articleId=" + docId, docId)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment