How can i get "a" elements of the div with class
<div class="membox_externalcontent">
<!-- find "a" elements of here -->
<div>
I have this code for get a element of body and i like to improve it:
function xpathh(){
var nodesSnapshot = document.evaluate('//body//a', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );
for ( var i=0 ; i < nodesSnapshot.snapshotLength; i++ )
{
var href = String(nodesSnapshot.snapshotItem(i).getAttribute('href'));
console.log(href);
}
}