Lurker News

Comments (70) 33 threads

Show all comments

Showing thread 1 of 33

tucosan2 replies#
Even after substituting the fancy ampersands on your homepage, and requiring nightmare your example still does not run:

  var Nightmare = require('nightmare');
  new Nightmare()
    .goto('http://yahoo.com')
    .type('input[title="Search"]', 'github nightmare')
    .click('.searchsubmit')
    .run();
yields:

  node yahoo.js
  phantom stdout: TypeError: 'null' is not an object (evaluating 'element.value = text')


  phantom stdout:   phantomjs://webpage.evaluate():3
    phantomjs://webpage.evaluate():4
    phantomjs://webpage.evaluate():4

  stream.js:94
        throw er; // Unhandled stream error in pipe.
              ^
  TypeError: undefined is not a function
      at next (/private/tmp/night/node_modules/nightmare/lib/index.js:56:23)
      at f (/private/tmp/night/node_modules/nightmare/node_modules/once/once.js:16:25)
      at Proto.apply (/private/tmp/night/node_modules/nightmare/node_modules/phantom/node_modules/dnode/node_modules/dnode-protocol/index.js:123:13)
      at Proto.handle (/private/tmp/night/node_modules/nightmare/node_modules/phantom/node_modules/dnode/node_modules/dnode-protocol/index.js:99:19)
      at D.dnode.handle (/private/tmp/night/node_modules/nightmare/node_modules/phantom/node_modules/dnode/lib/dnode.js:140:21)
      at D.dnode.write (/private/tmp/night/node_modules/nightmare/node_modules/phantom/node_modules/dnode/lib/dnode.js:128:22)
      at SockJSConnection.ondata (stream.js:51:26)
      at SockJSConnection.EventEmitter.emit (events.js:107:17)
      at Session.didMessage (/private/tmp/night/node_modules/nightmare/node_modules/phantom/node_modules/shoe/node_modules/sockjs/lib/transport.js:220:25)
      at WebSocketReceiver.didMessage (/private/tmp/night/node_modules/nightmare/node_modules/phantom/node_modules/shoe/node_modules/sockjs/lib/trans-websocket.js:102:40)
The examples in the githubs pages readme don't run either. I am too lazy to debug this.
resu_nimda#
I got it to run by providing a callback to the 'run' function: run(function(){ console.log('done'); });

By default there is no indication of completion, hence the log.

pkrein1 reply#
hey sorry about that, just realized i forgot to npm publish v1.1.0 -- published now hope that helps