nknj / mto-rates-scraper Goto Github PK
View Code? Open in Web Editor NEWScrapes Western Union, Moneygram and Bank of Ghana for GBP and EUR rates using CasperJS
Scrapes Western Union, Moneygram and Bank of Ghana for GBP and EUR rates using CasperJS
Hello freind
I need to login western-union with casperjs and get all headers after login .
Trying to run my script i got on debug consol this error:
[warning] [remote] unable to submit form
here my code:
var casper = require('casper').create({
verbose: true,
logLevel: 'debug',
waitTimeout: 5000,
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4',
viewportSize:{width: 1600, height: 900}
})
.on('error', function(msg) {
this.echo('Error: ' + msg, "ERROR");
})
.on('remote.message', function(msg) {this.echo('The error from evaluate: ' + msg, "ERROR");})
.start('https://www2.westernunion.com/fr/fr/send-money/app/login/', function() {
//this
//.click('#signin_link');
this.wait(0,function(){var i=0;
function snap(){i++;casper.capture('foo_'+i+'.jpg', undefined,{format: 'jpg',quality: 75});if(i<4){setTimeout(snap,1000)}}snap();
})
.fillSelectors('form', {
'#txtEmailAddr' : '[email protected]',
'#txtKey': 'tictac@2009'
}, true)
.waitForSelector("#btn-do-login",
function success() {
this
.echo('logged in!', 'INFO')
.capture('in.png')
},
function fail(){
this
.capture('failed.png')
.echo('failed to login', 'ERROR');
})
})
//Header
.then(function dumpHeaders(){
console.log("getting headers");
this.currentResponse.headers.forEach(function(header){
console.log(header.name +': '+ header.value);
})
})
.run()
any help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.