var zombie = require("zombie");
var assert = require("assert");
zombie.visit("http://google.de/", function (err, browser, status) {
browser.
fill("q", "pizza").
pressButton("btnG", function(err, browser, status) {
assert.equal(browser.text("title"), "pizza - Google Suche");
});
});
[...]
ck: [Function]
, jsrt_kill: 1
, y: { first: [] }
, x: [Function]
, dlj: [Function]
, dstr: []
, rein: []
}
, gbar: { qs: [Function], tg: [Function] }
, _listeners: { load: { false: [Object] } }
}
threw error
{ message: 'Uncaught, unspecified \'error\' event.'
, stack: [Getter/Setter]
}
handling event
{ _eventType: 'HTMLEvents'
, _type: 'error'
, _bubbles: true
, _cancelable: false
[...]
if (phantom.state.length === 0) {
phantom.state = "loading";
phantom.open("http://google.de/");
} else if (phantom.state == "loading") {
phantom.state = "submitted";
document.getElementsByName("q")[0].value = "pizza";
document.getElementsByName("btnG")[0].click();
} else if (phantom.state == "submitted") {
console.log("result: " + document.title);
phantom.exit();
}
result: pizza - Google-Suche
| Table of Contents | t |
|---|---|
| Source Files | s |
| Slide Numbers | n |
| Notes | 2 |
| Help | h |