如何在casperjs中加载另一个页面?

时间:2016-01-15 07:03:37

标签: javascript casperjs

我正在测试网站,然后我遇到了一个我要打开的链接并继续测试第二个网页

 casper.start('http://Firstsite.com', function() {
 //blablah my codeing 


    casper.start('http://Secondesite.com', function() { 
   //blablah my codeing for ('http://Secondesite.com', )
    });


 });

1 个答案:

答案 0 :(得分:1)

我在Casperjs文档页面http://docs.casperjs.org/en/latest/modules/casper.html#

找到了一个非常简单的解决方案
 casper.start('http://Firstsite.com', function() {
 //blablah my codeing 


  casper.thenOpen('http://Secondesite.com', function() { 
     //blablah my codeing for ('http://Secondesite.com', )
  });


});