V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
soulmine
V2EX  ›  Node.js

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

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