Questions tagged [nightmare]

Nightmare is a node module which implements a high-level bridge between node.js and the headless PhantomJS browser. Nightmare v2 switches to electron (atom-shell) as the underlying browser. Please include the version that you use in your question.

Definition:

According to the Official Documentation:

Nightmare is a high-level browser automation library from Segment.

The goal is to expose a few simple methods that mimic user actions (like goto, type and click), with an API that feels synchronous for each block of scripting, rather than deeply nested callbacks. It was originally designed for automating tasks across sites that don't have APIs, but is most often used for UI testing and crawling.

Under the covers it uses Electron, which is similar to PhantomJS but roughly twice as fast and more modern.

Important Links:

456 questions
3
votes
1 answer

Nightmare.js error code -3

I'm using nightmare to do few commands on a website. My code has few nightmare instances nested each other so I can handle the asynchronous call one by one. Sometimes my script runs successfull, but there are times that somehow nightmare throws an…
Jose Bernhardt
  • 887
  • 1
  • 10
  • 24
3
votes
2 answers

Testing NightmareJS code with Mocha fails

Recently I've started learning NodeJS and I have wrote a simple Youtube scraper, that uses NightmareJS and returns the number of likes, views, author and title names per video URL. Now I'm trying to unit test my code with Mocha(to practice some…
Evgeny
  • 415
  • 4
  • 17
3
votes
3 answers

Nightmare conditional wait()

I'm trying to crawl a webpage using Nightmare, but want to wait for #someelem to be present, only if it actually exists. Otherwise, I want Nightmare to move on. How can this be done using .wait()? I can't use .wait(ms). Using .wait(selector) means…
user
  • 183
  • 1
  • 2
  • 9
3
votes
1 answer

Clicking an image with nightmarejs

I've been struggling for a few days on this one issue. I am using nightmarejs to click an image on an Ebay product listing page. When clicked, the full-sized version of the image appears in a lightbox. Nightmarejs just won't click this image! I can…
bmills
  • 537
  • 1
  • 6
  • 12
3
votes
1 answer

How to have multiple evaluate methods run in nightmare.js?

I'm using nightmare.js to scrape webpage content. After authenticating the nightmare instance, I loop through multiple pages (that require a login) and then call the run method that executes all the page loads. From each page I want to grab…
3
votes
1 answer

Async challenge when looping over urls in nightmare.js

I'm using the async module to iterate over multiple urls with nightmarejs. I can't create a new nightmare instance because I will have to reauthenticate each time. So I'm trying to use the async module. I'm getting a (I think, classic) problem the…
3
votes
1 answer

NightmareJS doesn't return anything to the terminal?

I copy pasted the example on Github: app.js: var Nightmare = require('nightmare'); var vo = require('vo'); vo(function* () { var nightmare = Nightmare({ show: true }); var link = yield nightmare .goto('http://yahoo.com') …
alexchenco
  • 53,565
  • 76
  • 241
  • 413
3
votes
1 answer

nightmare.js not returning any output

I try to run my test.js file below with the command: DEBUG=nightmare node --harmony test.js and taking output: nightmare queueing action "goto" for http://google.com +0ms nightmare queueing action "wait" +2ms nightmare queueing action…
RedArrow
  • 588
  • 8
  • 18
3
votes
2 answers

nightmare js browsing and parsing multiple sites

I'm trying to automate 2 sites with github.com/segmentio/nightmare Example: I want to go on site_1 (temporary email service) and get an email. Then go to site_2 and fill that email, then submit a form. Then go to to site_1 and check if email…
DoctorP
  • 159
  • 2
  • 10
3
votes
2 answers

NightmareJS screenshot callback

I'm using this framework to make screenshots of several urls. The process of taking the screenshot is async, and the method does not provide a way to execute a callback, and I want to execute a callback when each screenshot is made on this…
fernandopasik
  • 9,565
  • 7
  • 48
  • 55
2
votes
2 answers

Get variable value from supplied js page in the console in JavaScript

Let me explain what is the issue. I am new here so please ignore my mistakes. I will try my best to explain myself. I am having a webpage.html and I included a js script like from script or may be inside