Phantomjs-framecontent-property
提供:Dev Guides
PhantomJS-frameContentプロパティ
このプロパティは、アクティブなフレームのコンテンツを返します。 プロパティを設定すると、このWebページのコンテンツがリロードされます。
構文
その構文は次のとおりです-
var page = require('webpage').create();
page.frameContent example;
例
*frameContent* プロパティの使用を理解するために例を見てみましょう。
var wpage = require('webpage').create();
wpage.open('http://localhost/tasks/contentl', function (status) {
console.log(status);
console.log(wpage.frameContent);//gives the content of the active frame
phantom.exit();
});
上記のプログラムは、次の output を生成します。
Success
<html>
<head></head>
<body>
<script type = "text/javascript">
console.log('welcome to cookie example');
document.cookie = "username = Roy; expires = Thu, 22 Dec 2017 12:00:00 UTC";
window.onload = function() {
console.log("page is loaded");
}
</script>
<iframe src = "http://localhost/tasks/al" width = "800" height = "800"
name = "myframe" id = "myframe"></iframe>
<h1>dddddddddd</h1>
</body>
</html>