.document.source() 編集を提案
現在のページのシリアライズされたソース文字列を取得します。
使用法
.document.source([callback])
例
module.exports = {
'get page source': function (browser) {
browser.document.source(function (result) {
console.log('current page source:', result.value);
});
},
'get page source using ES6 async/await': async function (browser) {
const pageSource = await browser.document.source();
console.log('current page source:', pageSource);
}
};
パラメータ
名前 | 型 | 説明 |
---|---|---|
callback 任意 |
function | 結果の値とともに呼び出されるコールバック関数。 |
戻り値
型 | 説明 |
---|---|
string | 現在のページのシリアライズされたソース文字列。 |