nightmare icon indicating copy to clipboard operation
nightmare copied to clipboard

Nightmare freezes doing evaluate()

Open jnpatrick99 opened this issue 6 years ago • 1 comments

I have the following code

let result = await this.nightmare.evaluate(selector => {
                        return Array.from(document.querySelectorAll(selector))
                            .map(element => element.innerText)
                            .filter((el) => {
                                return el && el != ''
                            });
                    }, 'a');

The page is quite huge, there can be 3000-5000 a tags sometimes. Nightmare freezes when there are around 4000 tags. Before that it doesn't. Sometimes it passes the mark 4500 tags. But after that it freezes again (throws timeout). The memory usage looks fine.

I tried to increase timeout - it didn't help. And I don't think it's the case - when there are less than 4000 tags the evaluate takes about 2 seconds max.

What can be the problem?

jnpatrick99 avatar Nov 18 '18 00:11 jnpatrick99

I also have the same issue

scottie avatar Mar 26 '19 07:03 scottie