THIS IS A WORK IN PROGRESS
SpecterJS is a scriptable headless browser with Internet Explorer bindings. SpecterJS aims to provide full API compatibility with PhantomJS.
SpecterJS is suitable for:
- Website testing
- Page automation
- Screen capture
- Web scraping
- Network monitoring
- etc.
Example:
> specterjs example.js
var page = require('webpage').create();
var url = 'http://www.google.com/';
page.viewportSize = {
width: 800,
height: 600
};
console.log("Loading web page: " + url);
page.open(url, function (status) {
console.log("Rendering page to screenshot.png");
page.render("screenshot.png");
phantom.exit();
});
For more examples please visit phantomjs.org/examples/. For command-line options refer to the compatibility table below.
Module | Status |
---|---|
child_process |
✅ Implemented |
cookiejar |
❌ Not Implemented |
fs |
✅ Implemented |
system |
✅ Implemented |
webpage |
|
webserver |
✅ Implemented |
specterjs [options] [script] [argument [argument [...]]]
Note: Executing SpecterJS without any arguments will engage Interactive Mode (REPL).
Option | Status |
---|---|
--cookies-file= | ❌ Not implemented |
--config= | ✅ Implemented |
--debug= | ❌ Not implemented |
--disk-cache= | ❌ Not implemented |
--disk-cache-path= | ❌ Not implemented |
--ignore-ssl-errors= | ✅ Implemented |
--load-images= | ❌ Not implemented |
--local-url-access= | ❌ Not implemented |
--local-storage-path= | ❌ Not implemented |
--local-storage-quota= | ❌ Not implemented |
--offline-storage-path= | ❌ Not implemented |
--offline-storage-quota= | ❌ Not implemented |
--local-to-remote-url-access= | ❌ Not implemented |
--max-disk-cache-size= | ❌ Not implemented |
--output-encoding= | ✅ Implemented |
--remote-debugger-port= | ❌ Not implemented |
--remote-debugger-autoru=n | ❌ Not implemented |
--proxy= | ❌ Not implemented |
--proxy-auth= | ❌ Not implemented |
--proxy-type= | ❌ Not implemented |
--script-encoding= | ❌ Not implemented |
--script-language= | ❌ Not implemented |
--web-security= | ❌ Not implemented |
--ssl-protocol= | ❌ Not implemented |
--ssl-ciphers= | ❌ Not implemented |
--ssl-certificates-path= | ❌ Not implemented |
--ssl-client-certificate-file= | ❌ Not implemented |
--ssl-client-key-file= | ❌ Not implemented |
--ssl-client-key-passphrase= | ❌ Not implemented |
--webdriver= | ❌ Not implemented |
--webdriver-logfile= | ❌ Not implemented |
--webdriver-loglevel= | ❌ Not implemented |
--webdriver-selenium-grid-hub= | ❌ Not implemented |
-w, --wd | ❌ Not implemented |
-h, --help | ✅ Implemented |
-v, --version | ❌ Not implemented |
Option | Valid values | Description |
---|---|---|
--emulation-mode= | ie7 , ie8 , ie9 , ie10 , ie11 or edge |
Sets the emulation mode for Internet Explorer. |
Global | Status | Notes |
---|---|---|
phantom |
✅ Implemented | — |
require() |
✅ Implemented | — |
console |
.log() , .error() and .info() are implemented so far. |
|
setTimeout() |
✅ Implemented | — |
setInterval() |
✅ Implemented | — |
clearTimeout() |
✅ Implemented | — |
clearInterval() |
✅ Implemented | — |
If you find any bugs, please report them in the issue tracker.
Pull requests are welcome!