Skip to content

Instantly share code, notes, and snippets.

@docteurklein
Created May 1, 2011 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save docteurklein/950578 to your computer and use it in GitHub Desktop.
Save docteurklein/950578 to your computer and use it in GitHub Desktop.
phantomJS config for sahi
<browserTypes>
<browserType>
<name>phantomjs</name>
<displayName>PhantomJS</displayName>
<icon>chrome.png</icon>
<path>/opt/phantomjs/bin/phantomjs</path>
<options>--proxy=localhost:9999 /opt/phantomjs/null.js</options>
<processName>phantomjs.sh</processName>
<capacity>5</capacity>
</browserType>
</browserTypes>
if (phantom.args.length === 0) {
if (phantom.args.length !== 1) {
console.log('Usage: phantomjs sahi.js URL');
phantom.exit();
}
else {
phantom.state = 'sahi';
console.log(phantom.args[1]);
phantom.open(phantom.args[1]);
}
}
else {
console.log(document.body.innerText);
phantom.exit();
}
@julesbou
Copy link

julesbou commented Aug 6, 2011

condition in line 2 seems really strange.
anyway thanks for this helpful gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment