Please tell me how to fix this? When the page is loaded with audio player phantomjs returns the following error:
ReferenceError: Can't find variable: Audio
Tried to search the Internet for a solution for its OS, but nothing found. OS: Debian 8.
My code (the part from the answer https://stackoverflow.com/a/35511597/3359390):
var page = require("webpage").create();
page.open("http://95.183.11.171/ph.php", function(status) {
page.evaluate(function() {
if (!window.Audio) {
window.Audio = function() {
return {
play: function() {},
pause: function() {}
};
};
}
});
setTimeout(function() {
phantom.exit();
}, 1000);
});