Last active
October 27, 2018 17:33
-
-
Save matthlavacka/89b5eb58e4b2c1f828aed8222d8dec80 to your computer and use it in GitHub Desktop.
Automatized Ryanair Check-in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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