I'm trying to take a screenshot of earth.nullschool.net with PhantomJS and Node.js.
This is the relevant code:
var phantom = require("phantom");
var url = "http://earth.nullschool.net/#current/wind/isobaric/10hPa/orthographic=0.00,0.00,350";
var timeout = 15000;
phantom.create(function(ph) {
ph.createPage(function(page) {
page.open(url, function(status) {
setTimeout(function() {
page.render("earth_0-0-350_#current.png", function(finished) {
ph.exit();
});
}, timeout);
});
});
});
I originally set the timeout
variable to 5 seconds. This returned a blank image that hasn't rendered the map.
I figured I needed a longer timeout to allow the page to fully load. So I have progressively made the timeout longer up to a full minute. But the output is the same. The map never renders.
After registering the event handlers (onConsoleMessage
, onError
, onResourceError
, onResourceTimeout
) I found the following error:
ERROR: TypeError: 'undefined' is not a function (evaluating 'i.bind(null,t,n)')
TRACE:
-> http://earth.nullschool.net/js/bundle.min.js?v20150923: 84
-> http://earth.nullschool.net/js/bundle.min.js?v20150923: 85
-> http://earth.nullschool.net/js/bundle.min.js?v20150923: 85
-> http://earth.nullschool.net/js/bundle.min.js?v20150923: 7 (in function "a")
-> http://earth.nullschool.net/js/bundle.min.js?v20150923: 7
-> http://earth.nullschool.net/js/bundle.min.js?v20150923: 84 (in function "n")
-> http://earth.nullschool.net/js/bundle.min.js?v20150923: 64