Skip to content

Instantly share code, notes, and snippets.

@matthlavacka
Last active October 27, 2018 17:33
Show Gist options
  • Save matthlavacka/89b5eb58e4b2c1f828aed8222d8dec80 to your computer and use it in GitHub Desktop.
Save matthlavacka/89b5eb58e4b2c1f828aed8222d8dec80 to your computer and use it in GitHub Desktop.
Automatized Ryanair Check-in
var casper = require("casper").create({
viewportSize: {
width: 1024,
height: 640
}
});
casper.start('https://www.ryanair.com/us/en/check-in', function() {
this.echo('Page ' + this.getTitle() + ' loaded');
this.waitForSelector('form[name=retrieveBookingForm]', function() {
this.echo('form found');
this.fillSelectors('form[name=retrieveBookingForm]', {
'input[name="reservationNum"]' : 'YOUR_RES_NUM',
'input[name="email"]' : 'chuck@norris.com',
}, true);
this.click('form[name=retrieveBookingForm] input[type="submit"]');
});
});
casper.then(function(){
this.wait(500, function(){
this.echo('Wait');
});
});
casper.then(function() {
this.waitForSelector('form.ng-submitted[name=retrieveBookingForm]', function() {
this.echo('Form submitted.');
this.capture('ryanair.png');
});
})
casper.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment