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.
I have the following code
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?