Node.js package to bypass WAF anti-bot JavaScript challenges
npm install humanoid-jsA Node.js package to bypass WAF anti-bot JS challenges.
Brotli content-encoding. Not supported by Node.js' request by default!
npm install --save humanoid-js
`Usage
Basic usage with promises:
`javascript
const Humanoid = require("humanoid-js");let humanoid = new Humanoid();
humanoid.get("https://www.cloudflare-protected.com")
.then(res => {
console.log(res.body) // ...
})
.catch(err => {
console.error(err)
})
`
Humanoid uses auto-bypass by default. You can override it on instance creation:
`javascript
let humanoid = new Humanoid(autoBypass=false)humanoid.get("https://canyoupwn.me")
.then(res => {
console.log(res.statusCode) // 503
console.log(res.isSessionChallenged) // true
humanoid.bypassJSChallenge(res)
.then(challengeResponse => {
// Note that challengeResponse.isChallengeSolved won't be set to true when doing manual bypassing.
console.log(challengeResponse.body) // ...
})
}
)
.catch(err => {
console.error(err)
})
`
async/await is also supported, and is the preferred way to go:
`javascript
(async function() {
let humanoid = new Humanoid();
let response = await humanoid.sendRequest("www.cloudflare-protected.com")
console.log(response.body) // ...
}())
``