Phantomjs-url-property

提供:Dev Guides
移動先:案内検索

PhantomJS-URLプロパティ

このプロパティは、現在のページURLを返します。

構文

その構文は次のとおりです-

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

次の例は、 URL プロパティの使用を示しています。

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

上記のプログラムは、次の output を生成します。

http://localhost/tasks/ptitlel