JS forEach
http://top.baidu.com/buzz?b=1
var mystr=''
$x('//*[@id="main"]/div[2]/div/table/tbody/tr/td[2]/a[1]').forEach((item,index)=>{
mystr=item.innerText.trim()+'\n'
})
console.info(mystr)
//console.info(index,item.innerText)
output:
http://top.baidu.com/buzz?b=1
var mystr=''
$x('//*[@id="main"]/div[2]/div/table/tbody/tr/td[2]/a[1]').forEach((item,index)=>{
mystr=item.innerText.trim()+'\n'
})
console.info(mystr)
//console.info(index,item.innerText)
output: