bypass cloudflare protection with casperjs or phan

2019-09-07 00:16发布

问题:

I use tor to access casperjs via this socks proxy my OS windows 10 x64

my test.js

var casper = require('casper').create({
verbose: true,
logLevel: 'error',
pageSettings: {
    loadImages: false, // The WebPage instance used by Casper will
    loadPlugins: false, // use these settings
    userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36'
    }
});
var caturl = ('http://www.test.com');
casper.start(caturl, function() {
    this.echo(this.getTitle());
});
casper.run();

result from my local machine

casperjs test.js
This Is Page Title

when open tor, and I'm sure its working fine also the socks proxy is working tested it before

casperjs  --proxy=127.0.0.1:9150 --proxy-type=socks5 test.js
Attention Required! | Cloudflare

the result as I see, that its want to solve recaptcha to open this site from cloudflare

BUT

when I open the tor browser, and open the link tested in casperjs, its open normally without any asking for recaptcha

WHY when open the link with casperjs ask for recaptcha , and when open the link with tor browser (same proxy IP used) it doesn't ask for recaptcha ?

is this related with useragent or what ?