Can't get proxy-settings working

497 views
Skip to first unread message

Jeremy S.

unread,
Aug 1, 2012, 10:19:53 AM8/1/12
to casp...@googlegroups.com
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"
});

casper.start('https://www.google.fr', function() {
  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
[debug] [phantom] opening url: http://www.google.fr/, HTTP GET
[debug] [phantom] Navigation requested: url=https://www.google.fr/, type=Ot
her, lock=true, isMainFrame=true
[warning] [phantom] Loading resource failed with status=fail: http://www.google.fr
[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?

[warning] [phantom] Loading resource failed with status=fail: http://www.google.fr

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

Paul Benson

unread,
Dec 19, 2018, 11:31:53 AM12/19/18
to CasperJS
Jeremy,

Were you able to figure this out?  I'm having the exact same issue.
Reply all
Reply to author
Forward
0 new messages