CasperJS: how to call __doPostBack
I'm trying to abandon a page: http://fd1-www.leclercdrive.fr/057701/courses/pgeWMEL009_Courses.aspx#RS284323
But as you can see that this link is redirected to fd1-www.leclercdrive.fr/057701/courses/pgeWMEL009_Courses.aspx the first time you access it. after you click "fruit et légumes" you can access the page using the direct url
Therefore, I need to simulate a click on the "Fruits et légumes" button to access the page I want. In the code, it does dopostback
Here is my code that I am using with casperj
:
var casper = require('casper').create({
verbose: true,
logLevel: "debug"
});
casper.start('http://fd1-www.leclercdrive.fr/057701/courses/pgeWMEL009_Courses.aspx#RS284323');
// here i simulate the click on "Fruits et légumes"
casper.evaluate(function() {
__doPostBack('objLienReceptdionEvenement','2@@284323');
});
casper.then(function() {
console.log(' new location is ' + this.getCurrentUrl());
});
casper.run();
I am still redirecting to the wrong page
+1
source to share