0

I'm using nightmarejs and I have a problem that I don't know how to solve.

I use the instruction goto(URL) followed by the instruction evaluate() in order to perform some operation on the webpage. The DOM is ready after 2-3 seconds but I believe that the instruction goto() waits for the full page download which is very heavy (it takes 6-7 seconds).

Is there a way to tell nightmare to start the evaluate() function as soon as the DOM is ready and NOT when the page is fully loaded?

Jacob
  • 493
  • 1
  • 5
  • 18

1 Answers1

1

Nightmare doesn't have support for passing extra arguments/options to goto function yet, nor it has the proper document about accessing window contents api provided by electron.

You can track if page loaded or not by dom-ready event, but you cannot probably do anything about it right now.

If there is a solution for this, I'll update the answer.

Md. Abu Taher
  • 13,012
  • 3
  • 35
  • 59