问题描述
我正在尝试从网页中获取一个数字。
我需要的信息的 xpath 是 //*[@id="page-height"]/div[3]/div[3]/div[2]/p[3]
,但是在 div#app__content
之后没有子数据。有什么办法可以得到吗? .这是我的代码。在此先感谢您。
const cheerio = require('cheerio');
const axios = require('axios');
axios.get('https://www.bbva.com.co/personas/productos/inversion/fondos/pais.html').then((response) => {
const a = cheerio.load(response.data)
//console.log(response.data);
const data = a('div.iframe__load > iframe');
root_url = data[0].attribs.src;
axios.get(root_url).then((res) => {
const b = cheerio.load(res.data)
const valor = b('#app__content');
console.log(valor);
});
});
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)