Is it safe to run multiple instances of Puppeteer at the same time?

后端 未结 3 1689
小蘑菇
小蘑菇 2021-02-01 20:50

Is it safe/supported to run multiple instances of Puppeteer at the same time, either at

  1. the process level (multiple node screenshot.js at the same ti
3条回答
  •  無奈伤痛
    2021-02-01 21:21

    Both will work but second one doesn't really make a sense. Reason for that is because nodeJS i single threaded. So even if process will work it won't be faster of easier to use multiple instances of browser in one process rather than in multiple processes. Best option is to run (1) as you did before, only thing you need to remember is to keep tests self contained.

提交回复
热议问题