How to start the casperjs from local webpage files?

35 views
Skip to first unread message

havy...@gmail.com

unread,
May 18, 2015, 4:55:35 AM5/18/15
to casp...@googlegroups.com
Hi, All,
I'm new to the CasperJS, please help me out of the problem.
Thanks in advance!

First Case: I start the casper from url by casper.start(“http://gzly.miit.gov.cn:8080/datainfo/miit/nycpscpzzsmd.jsp”). Then I do click on the nextpage button by casper.thenClick("//img[@src='images/button-down.gif']"). In this case, everything works well and I successfully reach the nextpage.

 

Second Case: I firstly saved the webpage to file(wget “http://gzly.miit.gov.cn:8080/datainfo/miit/nycpscpzzsmd.jsp” –O testpage.html). Then I try to start the casper from local file by casper.start(“testpage.html”). But in this case, I find that I can’t do effective click on the nextpage button any more, it just stays at the firstpage, nothing has changed after click on the nextpage button. 

So how can I start the casper from the static file and keep the nextpage button effective? 

dani...@gmail.com

unread,
Jun 3, 2015, 2:43:44 AM6/3/15
to casp...@googlegroups.com
up


Gabe Misura

unread,
Jun 18, 2015, 12:05:41 AM6/18/15
to casp...@googlegroups.com
The click your making is calling javascript which is not downloaded via your wget, so it fails to do anything when you try to run it locally.
Reply all
Reply to author
Forward
0 new messages