assaf/zombie — Issue #262: Trying to load yahoo home page fails with core.DOMException(HIERARCHY_REQUEST_ERR)
Author: stevelatif
Created: 2012-01-18 06:27:22+00:00
State: open

I tried to run a simple script that would load yahoo's front page, instead it threw an exception.
Running it against www.google.com it ran fine.

/Users/slatif/node_modules/zombie/node_modules/jsdom/lib/jsdom/level1/core.js:1337
throw new core.DOMException(HIERARCHY_REQUEST_ERR);
^
Error: Hierarchy request error
at Object.appendChild (/Users/slatif/node_modules/zombie/node_modules/jsdom/lib/jsdom/level1/core.js:1337:13)
at setChild (/Users/slatif/node_modules/zombie/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:173:17)
at HtmlToDom.appendHtmlToElement (/Users/slatif/node_modules/zombie/node_modules/jsdom/lib/jsdom/browser/htmltodom.js:77:9)
at Object.innerHTML (/Users/slatif/node_modules/zombie/node_modules/jsdom/lib/jsdom/browser/index.js:453:27)
at Object.write (/Users/slatif/node_modules/zombie/node_modules/jsdom/lib/jsdom/level2/html.js:405:22)
at /Users/slatif/node_modules/zombie/lib/zombie/history.coffee:130:20
at /Users/slatif/node_modules/zombie/lib/zombie/resources.coffee:139:18
at IncomingMessage. (/Users/slatif/node_modules/zombie/lib/zombie/resources.coffee:268:15)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.onMessageComplete (http.js:137:23)

var zombie = require("zombie");

zombie.visit("http://login.yahoo.com", function (err, browser) {
if (err)
throw(err.message);
console.log("Loaded:", browser.html());
});