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 I'm looking in the wrong place.
like this :)
const nightmare = Nightmare({
show: true,
webPreferences: {
images: false
}
});
You can use webRequest.onBeforeRequest in tandem with Nightmare's .action() to filter content.
You might want to check out nightmare-load-filter (disclaimer: I'm the author), I believe that does what you're looking to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With