Hi, I'm trying to write a very simple script to take a screenshot. This script is called repeatedly by an other python script and quite often it raises the error:
TypeError: Attempting to change the setter of an unconfigurable property.
The whole script is:
"use strict";
var webpage = require('webpage'),
system = require('system'),
address = system.args[1],
file = system.args[2];
var page = webpage.create();
page.open(address, function (status) {
setTimeout(function () {
var exitCode = 0;
if (status !== 'success') {
exitCode = 1;
} else {
page.render(file);
}
phantom.exit(exitCode);
}, parseInt(system.args[3]));
});
I'm not setting anything at all so I don't understand where the error comes from.
However in that case the script is written in python and uses the heimdal library to create the screenshots via PhantomJS.
Note: as far as I can tell all the screenshots are being saved, so it's just annoying to have that error message. The StackOverflow question linked above stated that sometimes the screenshots wouldn't be saved, so if there is a known solution I'd rather go with that instead of just hiding the error message.