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
4
votes
1 answer

Nightmare, PhantomJS and extracting page data

I'm new to Nightmare/PhantomJS and am struggling to get a simple inventory of all the tags on a given page. I'm running on Ubuntu 14.04 after building PhantomJS from source and installing NodeJS, Nightmare and so forth manually, and other functions…
Valerie R
  • 1,769
  • 9
  • 29
3
votes
1 answer

How to e2e test websites with disabled JavaScript and noscript tags?

I want to e2e test a website like when a user visits it with disabled javascript and/or some scripts blocked. cypress.io does not (officially) support testing websites with disabled JS so therefore one can not e2e test what users would see in case…
philk
  • 2,009
  • 1
  • 23
  • 36
3
votes
1 answer

.wait() nightmare and Puppeteer evaluate both failed to find an ID

I'm trying to get the reviews in aliexpress but for some reason wait() function always fail to find #transction-feedback So technically if you go to that link and click Feedback tap it will show all the reviews .click does work because it clicks…
sinusGob
  • 4,053
  • 12
  • 46
  • 82
3
votes
1 answer

npm audit fix not fixing low vulnerability

I am using nightmare for testing.After running npm audit I get a warning about lodash Prototype pollution.I tried to fix this by running npm audit fix but no result.After that I tried using --force but still get : fixed 0 of 1 vulnerability in 2108…
Manos Kounelakis
  • 2,848
  • 5
  • 31
  • 55
3
votes
3 answers

jQuery find element :contains, then get class

I am trying to get the class name of this item but it keeps returning undefined. var className = $(':contains("TRI-PACK PERTEX JACKET HIBISCUS")').attr('class'); 1: Here is the class I want it to return HTML Page:…
SPLY SPLY
  • 51
  • 8
3
votes
2 answers

How can I add a line break to each row in my returned table?

I am working on a web scraper and a table successfully prints, however the formatting of the table is terrible. I've tried a few things before now 1) const people = [...peopleList].map(personEntry => personEntry.innerText + '\n") 2) const people =…
Jason Harder
  • 439
  • 4
  • 16
3
votes
2 answers

Running E2E tests in a Kubernetes cluster

We've a fairly simple FE-BE combo that we deploy to a K8S cluster (Java + Spring Boot for BE, static React-based web app for the FE). We're also working on various E2E scenarios that exercise the whole system (using Nigthmare.js). In order to make…
Ilya Ayzenshtok
  • 721
  • 2
  • 7
  • 18
3
votes
0 answers

how to loop though elements in nightmare js

Im doing a project for my JS class. I want to build a nightmare.js script that sends a message to every product post on close5.com within a location. I already figured out how to login and send a message to a single product but I cant figure out how…
Tcmxc
  • 481
  • 1
  • 7
  • 23
3
votes
1 answer

Javascript Can't Pass Vars/Fn To .evaluate() Scope (NightmareJS)

I'm trying to pass a variable to .evaluate so I can use them in the scope of the web page but I can't get it to work. await nightmare.evaluate(function() { let links = document.querySelectorAll('div.fsl a'); return…
xendi
  • 2,332
  • 5
  • 40
  • 64
3
votes
0 answers

Nightmare JS `.goto(url)` loop

I'm working on a nightmare JS script that logs in to a website, builds a list of links based on results in a table then opens each of those links. On each link opened, some information is scraped and added to the end results. I'm having lots of…
Cat Burston
  • 2,833
  • 2
  • 12
  • 10
3
votes
2 answers

Testcafe+Nightmare: Why is element not in DOM?

I have the following test: fixture('Minimal reproduction') .page('http://www.sport-conrad.com/'); test('Navigate to item-details', async t => { await t .click('.dropdown-toggle') .click('.productData:first-of-type a') }); When I run…
AvantiC
  • 367
  • 3
  • 17
3
votes
0 answers

Weird behavior while scraping with NightmareJS - Explication needed

I'm trying to scrape the datas contained on a webpage using Nightmare and so, Electron. The code is at the bottom of my post ... I'm starting from this page Awfully long url. Where there is a list of hotel room offers. I want to get the url of the…
ale-naou
  • 31
  • 2
3
votes
0 answers

How to import Nightmarejs into angular-cli component

I'm going to make GUI scraper with Electron & Nightmare. However when I use just plain html/js as described in Electron quickstart, all works well. But I'd like to make Electron app nicely by using Anugular2(angular-cli webpack). I created project…
Evgheny Kalkutin
  • 197
  • 1
  • 1
  • 7
3
votes
2 answers

NightmareJS: How to block loading resources?

I am making a small scraper with nightmareJS but loading all the external resources takes ages and consumes tons of bandwidth. How can I only load the basic page html (without images, css etc)? I couldn't find any relevant information online, maybe…
Gloomy
  • 1,091
  • 1
  • 9
  • 18
3
votes
2 answers

NightmareJS save variable to file

The following code works with NightmareJS and NodeJS. However I don't want to just console.log my JSON result, but want to save my JSON result to a local file. I am aware of the .html option within Nightmare but I don't want the entire page and I…
user5754464
1 2
3
30 31