如何删除[].map(). a.href可能包含相同的href链接,我怎样才能阻止这种重复出现的数据?示例:www.example.com | www.example.comconst hrefs = await page.evaluate(() => { const anchors = document.querySelectorAll('a'); return [].map.call(anchors, a => a.href);});
1 回答

慕码人2483693
TA贡献1860条经验 获得超9个赞
Set hrefs = new Set([].map.call(anchors, a => a.href));
return [...hrefs];
添加回答
举报
0/150
提交
取消