Running an electron (atom-shell) without a head on a linux server via Nightmare.js

I am creating a scraper to make single-page JS applications easily crawlable.

After some incredible disappointments with PhantomJS (memory leaks, outdated web kit, undead processes, among many other problems), I decided to switch to NightmareJS , which can do the same, but uses Electron under the hood. An electron has many advantages (uses the latest chrome , much faster), but it requires an X server to work.

As I need it to work under the ubuntu server, I followed this icon . Now I have a large copy of EC2 with everything ready to launch a headless electron

xvfb-run electron 

The thing is, I need to run this through nightmareJS (which I will use on the node.js script server). I was wondering how I could pass parameters to a nightmare to start an electron through svfb

+7
nightmare headless-browser electron xvfb
source share
1 answer

I don’t know if there is a better way, but at least for my work the main process is started using the xvfb-run command:

 $ xvfb-run node --harmony simple-service.js Worker 12153 is online Worker 12155 is online Worker 12154 is online Worker 12156 is online 
+3
source share

All Articles