Hi Nicolas,
I am trying to get casperjs + phantomjs running under Windows7
1. downloaded phantom.js
2. downloaded casper.js
3. created testFile
phantom.casperPath = 'C:\\JSTesting\\casperjs';
phantom.injectJs(phantom.casperPath + '\\bin\\bootstrap.js');
var utils = require('utils');
utils.dump(phantom.casperArgs);
var links = [];
var casper = require('casper').create({
clientScripts: [
'libs/jquery.js'
],
verbose: true,
logLevel: "debug"
});
this.debugHTML();
this.fill('form[action="/search"]', { q: 'casperjs' }, true);
});
casper.run();
4. set phantom.js in PATH variable
5. run script with
phantomjs.exe --ignore-ssl-errors=yes --proxy-auth=<username>:<password> --proxy=http://<server>:<port> --debug=yes test.js --proxy-auth=<user>:<passpord> --proxy=http://<server>:<port> --ignore-ssl-errors=yes
Note: I attached it two times because I saw that the params were not in phantom.casperArgs when I attach it only before test.js like this
phantomjs.exe --ignore-ssl-errors=yes --proxy-auth=<username>:<password> --proxy=http://<server>:<port> --debug=yes test.js
When I run it the output is
{
"args": [],
"options": {
"proxy-auth": "<username>:<password>",
"proxy": "http://<server>:<port>",
"ignore-ssl-errors": "yes"
}
}
[info] [phantom] Starting...
[info] [phantom] Running suite: 2 steps
her, lock=true, isMainFrame=true
[debug] [phantom] Automatically injected libs/jquery.js client side
[debug] [phantom] Successfully injected Casper client-side utilities
[info] [phantom] Step 2/2 about:blank (HTTP 0)
<html><head></head><body></body></html>
[info] [remote] attempting to fetch form element from selector: 'form[action="/s
earch"]'
[error] [phantom] form error: form not found
[warning] [phantom] Errors encountered while filling form; submission aborted
[info] [phantom] Step 2/2: done in 1327ms.
[info] [phantom] Done 2 steps in 1392ms
Is there any way to get better info whats happening here?
I found this thread here but it is not really related to proxy issues
and this here the issue has been fixed
but I don't know whats wrong with my setup
Please assist