我正在尝试使用 Chromeless 获取 HTML 页面中所有 img 标记的 src 值。我目前的实现是这样的:
async function run() {
const chromeless = new Chromeless();
let url = 'http://someurl/somepath.html';
var allImgUrls = await chromeless
.goto(url)
.evaluate(() => document.getElementsByTagName('img'));
var htmlContent = await chromeless
.goto(url)
.evaluate(() => document.documentElement.outerHTML );
console.log(allImgUrls);
await chromeless.end()
}
问题是,我没有在allImgUrls
.