-
-
Save paps/a7755b94122f20df23094a9b687f9dd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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