Why CasperJS and browsers show different behaviors with CAPTCHA?

203 views
Skip to first unread message

zjiash

unread,
Mar 25, 2015, 8:03:25 AM3/25/15
to casp...@googlegroups.com

I'm using CasperJS to automate some of my tasks. 

CasperJS will meet captcha when exploring web pages. However, when I use browsers (chrome and safari) to access the page, I don't need to input the captcha. I try to set the userAgent option with the same value in browsers, but it does not work.

I want to know why CasperJS and browsers show different behaviors. And how can CasperJS pretend to be real browser? In other words, the web server cannot distinguish them. 

Thanks.

Darren Cook

unread,
Mar 25, 2015, 8:12:51 AM3/25/15
to casp...@googlegroups.com
> CasperJS will meet captcha when exploring web pages. However, when I use
> browsers (chrome and safari) to access the page, I don't need to input the
> captcha...

Assuming all browsing is coming from the same IP address, then this
sounds like you have a cookie that is being sent. E.g. maybe you have a
permanent cookie to keep you logged into gmail.com, so all google sites
are recognizing you.

Alternatively which engine are you using (Phantom 1.9, Phantom 2.0,
SlimerJS), and does it still happen if you switch from, say, Phantom to
SlimerJS?

Darren

zjiash

unread,
Mar 25, 2015, 9:27:55 PM3/25/15
to casp...@googlegroups.com
I use phantomjs 1.9.7 and I clear cookie when the program exits.

Eloi Tay

unread,
Mar 26, 2015, 10:49:24 PM3/26/15
to casp...@googlegroups.com, zji...@gmail.com
Hi
What darren meant was clear the cookie for your browser not casperjs although I am not sure if casperjs can even do that.
I do notice that you get captcha if you using some server IP that was tagged which I experience before which mean if you vpn into that machine and use the network and your browser you will get the same end result of the captcha screen or alternative if you browse around at a certain speed that they deem none humane the captcha will come up as well.
For a start, try the following
Run both your test and casperjs on the exact same machine, secondly use privacy mode when you try to test the same operation. If you can share with me how your script look like or what you were trying to do maybe I can try to figure out what exactly cause the bot detection to trip.
Reply all
Reply to author
Forward
0 new messages