



1 RelativeLayout OP var renren = "http://www.renren.com"; var casper = require("casper").create(); var counter = 0; function cap(){ casper.capture("step-"+counter+".png", { top: 0, left: 0, width: 1000, height: 1000 }); counter++; } casper.start(renren); casper.then(cap); casper.then(function(){ casper.fill("form#loginForm",{ 'email':'人人ID', 'password':"人人PASSWORD" },true); }); casper.then(cap); casper.run(); |
2 RelativeLayout OP 新浪微博的模拟就十分正常 |
3 binux 2013 年 2 月 18 日 登陆是ajax的,直接submit那个form是不行的 |
4 RelativeLayout OP |
5 binux 2013 年 2 月 18 日 casper.fill("form#loginForm",{ 'email':'人人ID', 'password':"人人PASSWORD" },false); casper.evaluate(function() { $('login').click(); }); 然后等一段时间再截屏 我没账号,后面怎么样我也不知道 |
6 jiangplus 2013 年 2 月 18 日 我以前也做过类似的事情,发现phantomjs/casperjs太坑了,用waitr轻松搞定 |
7 wong2 2013 年 2 月 18 日 这个东西能模拟提交表单,但是能执行页面的js么? |
8 RelativeLayout OP @wong2 能啊,他内部是webkit ,就是没有界面的浏览器。你可以去官方文档看看。 |
9 cain 2013 年 2 月 20 日 |
10 cain 2013 年 2 月 20 日 |
11 RelativeLayout OP @cain 试了,还是不工作。 不知道你能不能试一下人人的模拟登陆。 |