phantomjs and simple examples gives TypeError: Attempting to change the setter of an unconfigurable property

Viewed 2406

I'm working my way through the phantomjs examples but TypeError: Attempting to change the setter of an unconfigurable property. errors keep popping up. I wanted to pipe returned values to files but they are full of these error messages even with the simple examples see below.

var webPage = require('webpage');
var page = webPage.create();

page.settings.userAgent = 'Mozilla/5.0 (Linux; Android 9; SM-G960F Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Mobile Safari/537.36';


page.open('http://m.bing.com', function(status) {

  var title = page.evaluate(function() {
    return document.title;
  });

  console.log(title);
  phantom.exit();

});

Produces:

Bing
TypeError: Attempting to change the setter of an unconfigurable property.
TypeError: Attempting to change the setter of an unconfigurable property.

It should send back just Bing any workarounds?

I'm using PhantomJS 2.1.1 on Ubuntu 18.04 64bit.

0 Answers
Related