Skip to content

Instantly share code, notes, and snippets.

@paps
Created August 28, 2017 10:17
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 paps/a7755b94122f20df23094a9b687f9dd6 to your computer and use it in GitHub Desktop.
Save paps/a7755b94122f20df23094a9b687f9dd6 to your computer and use it in GitHub Desktop.
let cvRequestId = null
tab.driver.client.Network.responseReceived((e) => {
if (e.type === "XHR" && e.response.url.indexOf("profile-profilePdf/") > 0) {
cvRequestId = e.requestId
}
})
tab.driver.client.Network.loadingFinished((e) => {
if (e.requestId === cvRequestId) {
tab.driver.client.Network.getResponseBody({ requestId: cvRequestId }, (err, cv) => {
require("fs").writeFileSync("linkedin-cv.pdf", Buffer.from(cv.body, (cv.base64Encoded ? 'base64' : 'utf8')))
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment