在PhantomJS

时间:2015-11-12 17:21:22

标签: pdf phantomjs webpage

打开第一页'或者'打开第2页'以随机顺序发生。谁能告诉我为什么会这样?有没有办法让他们按顺序打开?

var page = require('webpage').create();
var page1 = require('webpage').create();
var page2 = require('webpage').create();


page.open('http://www.yourhtmlsource.com/myfirstsite/', function () {
  setTimeout(function(){

    console.log('opened page one');


   // phantom.exit();
  }, 2000); 
 });
page1.open('http://csb.stanford.edu/class/public/pages/sykes_webdesign  /05_simple.html', function () {
  setTimeout(function(){

   console.log('opened 2nd page');

   }, 2000);
});
page2.open('http://www.sheldonbrown.com/web_sample1.html', function () {
  setTimeout(function(){

    console.log('opened 3rd');
    phantom.exit();

    }, 2000);
});

0 个答案:

没有答案
相关问题