Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled stream error when working with JQuery #27

Closed
obihill opened this issue Jan 23, 2015 · 2 comments
Closed

Unhandled stream error when working with JQuery #27

obihill opened this issue Jan 23, 2015 · 2 comments

Comments

@obihill
Copy link

obihill commented Jan 23, 2015

I am trying to get the value of a link using JQuery. Here is my code

var $ = require('jquerygo');

$.config.addJQuery = true;
$.config.JQuery = 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js';

// Visit the user path and log in.
$.visit('http://www.restive.io', function() {

  $.waitForPage(function(){
    // Get the value of a link
    var result = $("#bs-prime-links .container .b-line").html();
    console.log(result);
    $.close();
  });
});

However, when I run this I get the following error:

Navigating to http://www.restive.io
Viewport set to: 1920x1080
Console:1920
Console:1
undefined
Closing

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
TypeError: Cannot call method 'call' of undefined
    at context (/root/dev/jquerygo/node_modules/jquerygo/lib/jquery.go.js:215:16)
    at page.evaluate.selector (/root/dev/jquerygo/node_modules/jquerygo/lib/jquery.go.js:187:16)
    at Proto.apply (/root/dev/jquerygo/node_modules/jquerygo/node_modules/phantom/node_modules/dnode/node_modules/dnode-protocol/index.js:123:13)
    at Proto.handle (/root/dev/jquerygo/node_modules/jquerygo/node_modules/phantom/node_modules/dnode/node_modules/dnode-protocol/index.js:99:19)
    at D.dnode.handle (/root/dev/jquerygo/node_modules/jquerygo/node_modules/phantom/node_modules/dnode/lib/dnode.js:140:21)
    at D.dnode.write (/root/dev/jquerygo/node_modules/jquerygo/node_modules/phantom/node_modules/dnode/lib/dnode.js:128:22)
    at SockJSConnection.ondata (stream.js:51:26)
    at SockJSConnection.emit (events.js:95:17)
    at Session.didMessage (/root/dev/jquerygo/node_modules/jquerygo/node_modules/phantom/node_modules/shoe/node_modules/sockjs/lib/transport.js:220:25)
    at WebSocketReceiver.didMessage (/root/dev/jquerygo/node_modules/jquerygo/node_modules/phantom/node_modules/shoe/node_modules/sockjs/lib/trans-websocket.js:102:40)

I don't know why this is happening. Kindly assist.

@obihill obihill closed this as completed Jan 30, 2015
@sujith97
Copy link

sujith97 commented Aug 2, 2015

@obihill What fixed this issue since you already closed it?

@obihill
Copy link
Author

obihill commented Aug 3, 2015

@sujith97 Not using JqueryGo anymore. Kindly refer to the following issue for more on how you can use JQuery with PhantomJS: Issue #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants