Node.js module that checks DOM elements

I use zombie.js , a mute browser mainly for testing. It creates a browser object, which, after calling the function, visit()allows you to play from the DOM of this page. However, I could not bring it to such an extent. There seems to be a problem with the parser used in zombies. Here is the error:

User/murf/Documents/workspace/node_code/node_modules/zombie/node_modules/html5/lib/html5/tokenizer.js:62

Has anyone found a similar problem? If so, is there a way around this? Or maybe there is another node module that does similar work? Any idea is welcome.

thank

+3
source share
1 answer

ZombieJS - JSDOM, , Zombie. , , "", JSDOM, :

var jsdom = require("jsdom");

jsdom.env("http://nodejs.org/dist/", [
  'http://code.jquery.com/jquery-1.5.min.js'
], function(errors, window) {
  console.log("there have been", window.$("a").length, "nodejs releases!");
});

JSDOM, , , , , , , keydown

$('someInput')
              .val('x')
              .keydown();

- type('x'), . Google, .
, , keydown keyCode .

Node, htmlnode, , , HtmlUnit.

:

+5

All Articles