code: def puppeteer(ctx, port, auto_restart, args):
      
  
      import subprocess
      g = ctx.obj
      _quit = []
      puppeteer_fetcher = os.path.join(
          os.path.dirname(pyspider.__file__), 'fetcher/puppeteer_fetcher.js')
      cmd = ['node', puppeteer_fetcher, str(port)]
  
      try:
          _puppeteer = subprocess.Popen(cmd)
      except OSError:
          logging.warning('puppeteer not found, continue running without it.')
          return None
  
      def quit(*args, **kwargs):
          _quit.append(1)
          _puppeteer.kill()
          _puppeteer.wait()
          logging.info('puppeteer exited.')
  
      if not g.get('puppeteer_proxy'):
          g['puppeteer_proxy'] = '127.0.0.1:%s' % port
  
      puppeteer = utils.ObjectDict(port=port, quit=quit)
      g.instances.append(puppeteer)
      if g.get('testing_mode'):
          return puppeteer
  
      while True:
          _puppeteer.wait()
          if _quit or not auto_restart:
              break
          _puppeteer = subprocess.Popen(cmd)
docs: Run puppeteer fetcher if puppeteer is installed.