我正在研究 phantomjs 示例,但出现TypeError: Attempting to Change the setter of an unconfigurable property。 错误不断出现。我想将返回的值通过管道传输到文件,但即使有下面的简单示例,它们也充满了这些错误消息。
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();
});
Run Code Online (Sandbox Code Playgroud)
生产:
Bing
TypeError: Attempting to change the setter of an unconfigurable property.
TypeError: Attempting to change the setter of an unconfigurable property.
Run Code Online (Sandbox Code Playgroud)
它应该只发回Bing任何解决方法吗?
我在 Ubuntu …