Хочу вывести содержание одной ноды.
axios.get('example.com')
.then((res) => {
let xmlDoc = libxmljs.parseXml(res.data)
let gchild = xmlDoc.get('//*[@id="wrap"]/div[2]/div/div[2]/div[3]/article/header/h1')
console.log(gchild.text())
})
Выбивает ошибку
{ Error: Extra content at the end of the document
at Object.module.exports.fromXml (/home/***/Documents/WORK/SCRAPE-BOTS/axios-test/node_modules/libxmljs/lib/document.js:168:21)
at axios.get.then (/home/nman/Documents/WORK/SCRAPE-BOTS/axios-test/index.js:15:27)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7) domain: 1, code: 5, level: 3, column: 2, line: 1 }
Можно ли этой библой пропарсить HTML?