T
T
teodor7teodor72016-12-25 15:52:19
PhantomJS
teodor7teodor7, 2016-12-25 15:52:19

How to make a mail.ru creator on casperjs?

Why writes registration in this domain is not available.

var casper = require('casper').create();
casper.options.viewportSize = {width:1024 ,height: 768};
var fs = require('fs'); 

//casper.userAgent('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36');
casper.start('https://m.mail.ru/cgi-bin/reg');

casper.then(function() {
   this.wait(1000, function() { 
   this.capture('start.png');
}); });
casper.then(function() { 
   var genderName = this.evaluate(function() {
      return  'input#'+document.querySelector('form.reg_form input[type=radio]').id;
   });
   this.fillSelectors('form.reg_form', {
     'input': 'Ivan',
   },false);

// this.click('#man1');
   this.sendKeys('#Username','casperjs');
   this.click(genderName);
});

casper.then(function() {
this.fillSelectors('form.reg_form', {
   'input#Username': 'ca75122',
   'input.birthday': '11',
   'select[name=BirthMonth]': '12',
   'input.birthyear': '1981',
},false);
this.wait(1000, function() { 
this.capture('midle.png');
});this.fillSelectors('form.reg_form', { 
  'input.birthday': '11',},true);
   this.wait(1000, function() {
      this.capture('end.png');
   });
});
casper.run();
What could be the reasons?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2017-05-24
@RidgeA

Most likely 2 times the event is triggered.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question