0

Here is en example about running phantomjs and passing parameters to it. But how to pass --disk-cache=true to it? Does this correct version?

var childArgs = [
  path.join(__dirname, 'phantomjs-script.js'),
  'argumentForJsScript',
  '--disk-cache=true',
  '--disk-cache-path=C:\somepath'
]

I am tryinh to run this and everythings seems to work, but folder C:\somepath don't contain any files. So it seems that disk-cache parameters are not recognized by phamtomjs engine and just passed to the js script. Are they?

Cherry
  • 28,337
  • 55
  • 193
  • 326

1 Answers1

0

Any parameters that are meant for PhantomJS should be passed before a script.

var childArgs = [
  '--disk-cache=true',
  '--disk-cache-path=C:\somepath',
  '--cookies-file=C:\somepath\cookies.txt',
  path.join(__dirname, 'phantomjs-script.js'),
  'argumentForJsScript'
]
Vaviloff
  • 14,967
  • 3
  • 43
  • 48