soulmine
V2EX  ›  Node.js

用 js 做爬虫 并发获得了 10 个链接 然后用 chromeless 去加载 有什么办法可以一个一个的加载 而不要一下子打开 10 个页面

  •  
  •   soulmine · Jun 7, 2018 · 5059 views
    This topic created in 3081 days ago, the information mentioned may be changed or developed.
    4 replies  •  2018-06-10 21:17:05 +08:00
    cctv1005s927
    cctv1005s927
    Jun 7, 2018
    1
    这个一般都是用 promise 去控制的,promise 文档翻一翻吧。
    yuanfnadi
    yuanfnadi
    Jun 7, 2018
    2
    const urlList = []
    for(let i = 0;i<urlList.length;i++){
    await page.open(urlList[1]);
    await page.close()
    }
    airdge
    airdge
    Jun 10, 2018
    4
    async/await promise
    async.eachSeries
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3628 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:50 · PVG 17:50 · LAX 01:50 · JFK 04:50
    ♥ Do have faith in what you're doing.