Skip to content

Instantly share code, notes, and snippets.

@paps
Created August 25, 2017 15:10
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/b7bd3a06a1ff0beb81c6e413d063bcdb to your computer and use it in GitHub Desktop.
Save paps/b7bd3a06a1ff0beb81c6e413d063bcdb to your computer and use it in GitHub Desktop.
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