I want to get attribute of only string in <em>
tags of HTML page
I want to get "(868)"
1.
casper.then(function() {
var word = require('utils').dump(this.getElementAttribute(x('//*[@id="content"]/div[2]/h4/em'), 'em'));
console.log(word)
});
2.
casper.then(function() {
var word = require('utils').dump(this.getElementAttribute(h4[class="head"], 'em'));
console.log(word)
});
I tried both but it returns "null" How to solve the problem?