Skip to content

Commit 67db02c

Browse files
committed
Closes n1k0#9 - Disabled image loading in phantom scraping script, perf boost.
1 parent cc36536 commit 67db02c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

phantom-scrape.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ if (userAgent) {
2727
page.settings.userAgent = userAgent;
2828
}
2929

30+
// disable loading images as we don't use them
31+
page.settings.loadImages = false;
32+
33+
// ensure we don't waste time trying to load slow/missing resources
34+
page.settings.resourceTimeout = 1000;
35+
3036
page.open(url, function(status) {
3137
if (status !== "success") {
3238
return exitWithError("Unable to access " + url);

0 commit comments

Comments
 (0)