/web-scraping-in-2017_captcha.js Secret
Created
August 25, 2017 15:10
Star
You must be signed in to star a gist
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
if (await tab.isVisible(".captchaImage")) { | |
// Get the URL of the generated CAPTCHA image | |
// Note that we could also get its base64-encoded value and solve it too | |
const captchaImageLink = await tab.evaluate((arg, callback) => { | |
callback(null, $(".captchaImage").attr("src")) | |
}) | |
// Make a call to a CAPTCHA solving service | |
const captchaAnswer = await buster.solveCaptchaImage(captchaImageLink) | |
// Fill the form with our solution | |
await tab.fill(".captchaForm", { "captcha-answer": captchaAnswer }, { submit: true }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment