davglass/nodejs-yui3 — Issue #21: dom query cease to be effective
Author: huang47
Created: 2011-12-21 11:27:12+00:00
State: open

EXAMPLE:
https://github.com/davglass/nodejs-yui3/tree/master/examples/scrape.js

ENV:
node: 0.6.6
npm; 1.1.0-beta-4

DESCRIPTION:
run scrape.js directly and we get below messages

info: (get): Loaded: /Users/hugeh/node_modules/yui3/node_modules/yui3-core/build/intl/intl-min.js
info: (get): Loaded: /Users/hugeh/node_modules/yui3/node_modules/yui3-core/build/intl/intl-min.js
error: (nodejsyui3): ----------------------------------------------------------
error: (nodejsyui3): TypeError: Cannot call method 'set' of null
error: (nodejsyui3): at Object. (/Users/hugeh/Dropbox/project/nodejs-yui3/examples/scrape.js:10:20)
error: (nodejsyui3): at [object Object]._notify (/Users/hugeh/node_modules/yui3/node_modules/yui3-core/build/yui/yui-min.js:7:5959)
error: (nodejsyui3): at Object. (/Users/hugeh/node_modules/yui3/node_modules/yui3-core/build/yui/yui-min.js:7:5803)
error: (nodejsyui3): at [object Object]._notify (/Users/hugeh/node_modules/yui3/node_modules/yui3-core/build/yui/yui-min.js:7:5959)
error: (nodejsyui3): at Object. (/Users/hugeh/node_modules/yui3/node_modules/yui3-core/build/yui/yui-min.js:8:730)
error: (nodejsyui3): at [object Object]._notify (/Users/hugeh/node_modules/yui3/node_modules/yui3-core/build/yui/yui-min.js:7:5959)
error: (nodejsyui3): at Object. (/Users/hugeh/node_modules/yui3/node_modules/yui3-core/build/yui/yui-min.js:8:785)
error: (nodejsyui3): at [object Object]._use (/Users/hugeh/node_modules/yui3/node_modules/yui3-core/build/yui/yui-min.js:8:2095)
error: (nodejsyui3): at [object Object]. (/Users/hugeh/node_modules/yui3/node_modules/yui3-core/build/yui/yui-min.js:8:693)
error: (nodejsyui3): at Object._finish (/Users/hugeh/node_modules/yui3/node_modules/yui3-core/build/yui/yui-min.js:13:2497)
error: (nodejsyui3): ----------------------------------------------------------

In case I modify it as below

#!/usr/bin/env node
var YUI = require("yui3").YUI;

YUI({ debug: true }).use('node', 'io', function(Y) {
YUI().use('node', function(remotePage) {
var url = 'http://digg.com/news';
remotePage.fetch(url, function() {
var newsItems = remotePage.all('#story-items h3');
// newsItems is empty
});
});
});

there is still no data returned.
{ _query: '#story-items h3', _nodes: [] }

is it because of yui3.4 dependency change?