A puppeteer-extra plugin to interact/solve captcha with API. (With no catches)
npm install puppeteer-extra-plugin-capsolver-catchlesspuppeteer-extra.
javascript
const puppeteer = require('puppeteer-extra')
const CapSolverPlugin = require('puppeteer-extra-plugin-capsolver')({
apiKey: 'CAI-XXX ...',
verboseLevel: 1,
retry: true // hcaptchaclicker: by default will retry challenges
})
puppeteer.use(CapSolverPlugin)
`
š± HCaptcha (DOM feature)

- await page.hcaptchaclicker(checkboxFrame=undefined) - handle a page including hcaptcha checkbox iframe example script (how to use).
- Will detect for failed callenges (and retry) and for double challenges that sometimes appears.
- Catch .hcaptchaclicker() exceptions for unsupported challenges.
- Read more about recognize captcha images through HCaptcha Image Classification.
`javascript
// get custom hcatpcha checkbox iframe
const desiredCheckboxFrame = await page.$("iframe[src*='custom-link-for-iframe-selector']")
await page.hcaptchaclicker(desiredCheckboxFrame) // pass no frame for detect the first on the page
.then(async (page) => {
// submit if passed the challenge
await page.click('#submit-my-form')
await page.waitForNavigation()
}).catch((e) => {
// ! catch clicker exception
console.log(e)
})
`
š Handler / Solving Tasks API Wrapper
-
- Based on capsolver-npm (nodejs api wrapper for capsolver.com api).
- Handler it's attached to any puppeteer page.
- Use the handler with:
`javascript
await page.capsolver()
`
- Perform any task that capsolver-npm brings.
- Supported captcha tasks listed on capsolver-npm at capsolver-npm#Supported API methods.
example: retrieve handler and call for funcaptcha token.
`javascript
await page.capsolver()
.funcaptchaproxyless(websiteURL, websitePublicKey, funcaptchaApiJSSubdomain) // see required parametes by https://github.com/0qwertyy/capsolver-npm#-supported-captcha-tasks
.then((results) => {
if (results.error !== 0) {
// createTask solution
const token = results.solution
} else {
console.log(got an error! ${JSON.stringify(results.apiResponse)})
}
}).catch(e => {
console.log(e)
})
`
- Note that await page.capsolver().runAynTask()` it's also supported in the case of tasks that are not supported by task-bind methods.