PhantomJS - title Property



This property returns the title of the page you are reading.

Syntax

Its syntax is as follows −

var wpage = require('webpage').create(); 
wpage.title;

Example

The following example shows the use of title property.

var wpage = require('webpage').create(); 
wpage.open('http://localhost/tasks/ptitle.html', function (status) {  
   console.log(wpage.title); 
   phantom.exit(); 
}); 

The above program generates the following output.

Testing PhantomJs
phantomjs_webpage_module_properties.htm
Advertisements