I am trying to download a webpage using PhantomJS with the code shown below, where "address" is the url and "dir" is the file path where i download the web page code.
var system = require('system');
var page = require('webpage').create();
var fs = require('fs');
// Set the url address
address = system.args[1];
// Set the file path
var dir = system.args[2];
page.open(address, function () {
fs.write(dir, page.content, 'w');
phantom.exit();
});
This works correctly in many webpages, but in this case ("http://www.lefties.com/es/es/woman/zapatos-c1029521.html") i can't see the href of the products because when I download it with phantomJS or without it, what is downloaded is a fullscreen popup with the cookie subscription. That makes no way to to find the products href in the html downloaded.
In addition, PhantomJS shows this error when i download it:
TypeError: 'null' is not an object (evaluating '$('PopupFullscreen').getElementById('Close').setStyles')
Any idea to avoid the subscription/cookie popup?