const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('https://www.jd.com/'); const hrefArr = await page.evaluate(() => { let arr = []; const aNodes = document.querySelectorAll('.cate_menu_lk'); aNodes.forEach(function (item) { arr.push(item.href) }) return arr }); let arr = []; for (let i = 0; i