【发布时间】:2015-03-23 23:15:10
【问题描述】:
我现在更新了 CasperJS 脚本,见下文
var casper = require('casper').create();
casper.start('http://whatismyipaddress.com/', function() {
if (this.exists('#section_left > div:nth-child(2)')) {
var data = this.getElementInfo('#section_left > div:nth-child(2)');
console.log(JSON.stringify(data.text));
}
});
casper.run();
如何从下面得到的结果中删除 " 和 \n 和 \t。
"\n\n23.221.147.202\n\n\t\t\t\t\t"
【问题讨论】:
标签: javascript string casperjs stringify