zombie.js

Load a web page, execute its JavaScript and dump resulting HTML to a file

ぃ、小莉子 提交于 2019-12-20 02:36:13
问题 I need to load a web page, execute its JavaScript (and all js files included with the tags) and dump resulting HTLM to a file. This needs to be done on the server. I have tried node.js with zombie.js but it seems it is too immature to work in the real world. More often than not it just throws a bogus exception while a real browser (FireFox) has no issues with the page. My node.js code is: var zombie = require("zombie"), sys = require('sys'); // Load the page var browser = new zombie.Browser({

Module version mismatch with headless browser and desktop Node

只谈情不闲聊 提交于 2019-12-19 10:09:20
问题 I'm getting a "Module version mismatch error" when I try to use a headless browser with a desktop Node shell. I've tried Zombiejs and Phantomjs with both nw.js and atom-shell; in both cases as soon as the headless browser comes into play the application crashes with a module mismatch error. Here's the error with Phantomjs and atom-shell: Uncaught Exception: Error: Module version mismatch. Expected 41, got 14. at Error (native) at Object.module.(anonymous function) (ATOM_SHELL_ASAR.js:118:20)

Can I make Behat/ZombieJS/Mink simulate a click on a “non-link” element, to fire JS listeners?

只愿长相守 提交于 2019-12-19 07:23:16
问题 I am using Behat for testing, with the ZombieJS driver, and everything is working very well so far, but there is one thing that bothers me, I can't seem to figure out how to get Behat to simulate a click on a non-link element. I guess this comes from Mink being a "cross-browser" driver, and it doesn't really make sense to click on non-link elements. For my use case though, I need it, because there are several elements on the page that have javascript event listeners attached to them, and I

Verifying Qunit's results with Zombie.js

半腔热情 提交于 2019-12-13 15:36:07
问题 I am doing test-driven development with Qunit: when creating a new function, I write tests for it, create the function, reload the page, and if all the tests pass I move on... Whilst this works fine at the beginning, it starts to become a time consuming process after a while as all the tests take several seconds to run, and that's the time I have to wait for every time I refresh my browser. In an attempt to workaround that problem, I thought about introducing Zombie.js to perform head-less

ZombieJS: intermittently crashes when called repeatedly from a for loop

自作多情 提交于 2019-12-13 06:47:49
问题 I have a ZombieJS node server on Heroku scrapping data from the internet. The server code is called from a for loop on the client side. Each iteration of the loop makes a server call which makes a Zombie scrape. Sometimes, the server will crash with the error below. It only happens when there is more than one iteration of the for loop. How can I make the code robust enough to handle multiple simultaneous client calls, each with a for loop. Code: var express = require('express'); var app =

Zombie.js jQuery Load Error 'j.getClientRects is not a function'

邮差的信 提交于 2019-12-11 05:17:59
问题 So first I have read this Stack Overflow question and it doesn't look like my same issue. Basically I'm trying to use Mocha and Zombie.js to run some tests on my Node.js site. I'm trying to check to see if I can create a user. In the end I would like to check to see if my bootstrap modal exists. Basically I have the bootstrap modal wrapped in an EJS if statement so there is defiantly a chance it might not exist. So that is why I'm trying to run tests on it. But currently it's not even working

Zombie.js pressButton Long Callback Delay

ぃ、小莉子 提交于 2019-12-10 12:49:23
问题 I've been trying to figure this out by using a bunch of console.logs and still can't figure out why these load times are so long. So I have the following code in my beforeEach in my Mocha unit test file. browser.fill('email', 'test1@test.com'); browser.fill('password', 'testtest'); browser.pressButton('Login').then(function () { console.log("#100 - "+ new Date().getTime()); done(); }); Pressing the button in this case will have a few redirects then finally display a dashboard page. At the

Windows 8 : `node-gyp rebuild` Exit status 1 installing contextify as dependency of zombie

心已入冬 提交于 2019-12-05 18:55:53
I'm trying to install zombie js, and get this error: > contextify@0.1.8 install C:\Users\User\Documents\ArbeitPhilipp\clieman\billing\node_modules\zombie\node_modules\jsdom\node_modules\contextify > node-gyp rebuild Das System kann den angegebenen Pfad nicht finden. C:\Users\User\Documents\ArbeitPhilipp\clieman\billing\node_modules\zombie\node_modules\jsdom\node_modules\contextify>node "C:\Program Files (x86)\nodejs\nod e_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild gyp ERR! configure error gyp ERR! stack Error: spawn ENOENT gyp ERR! stack at

Using jQuery in Zombie.js

佐手、 提交于 2019-12-05 06:55:58
I realize there are other libraries designed for the use of jQuery-like syntax with Zombie, but for my purposes, I specifically want/need to use jQuery itself in order to maintain compatibility with some earlier-written code. I installed the npm jQuery package, and I've been trying to import jQuery into my script and then initialize it with the window returned by Zombie like so: var Zombie= require("zombie"), $ = require("jquery") , zombie = new Zombie(); zombie.visit("http://www.mysite.com", function (err, browser, status) { if(err) { console.log("Error: " + err); } //Initialize a new jQuery

Injecting javascript into zombie.js

前提是你 提交于 2019-12-04 12:28:58
问题 Hi I was wondering if there is the ability in node js and zombie js to inject javascript files in to the headless browser, similar to what you can do with phantomjs. For example in phantom js you would do: page.injectJs("amino/TVI.js") I have used phantomjs and it does do what I want it to do but however I am testing other options due to the high memory required by using phantom js. 回答1: you can append script tag into document object since it support DOM API in zombie. The following example