Ashley Coolman
Ashley Coolman

Reputation: 11585

How to open a page with Phantomjs without running js or making subsequent requests?

Is there a way to just load the server generated HTML (without any js or images)?

The docs seem a little sparse

Upvotes: 1

Views: 78

Answers (1)

Vaviloff
Vaviloff

Reputation: 16838

The strength of PhantomJS is exactly in its ability to emulate a real browser, which opens a page and makes all the subsequent request. If you want just html maybe better use curl or wget?

But nevertheless there is a way not to run js or load images: set corresponding page settings: http://phantomjs.org/api/webpage/property/settings.html

page.settings.javascriptEnabled = false;
page.settings.loadImages = false;

Upvotes: 1

Related Questions