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
  • 31,309
  • 66
  • 224
  • 364

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
  • 16,282
  • 6
  • 48
  • 56