I am trying to scrap a page : http://fd1-www.leclercdrive.fr/057701/courses/pgeWMEL009_Courses.aspx#RS284323
But as you can see this link redirect to fd1-www.leclercdrive.fr/057701/courses/pgeWMEL009_Courses.aspx when you first access it. after you click on "fruits et légumes" you can access the page using the url directly
So I need to simulate a click on the button "Fruits et légumes" to access the page I want. In the code, it does a dopostback
Here is my code that I use with casperj
s :
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 still be redirected to the wrong page