HTMLソースを取得
フィールド名
値
Script
$wc = New-Object System.Net.WebClient
$url = "http://www.filemaker.co.jp/"
$st = $wc.OpenRead($url)
$enc = [System.Text.Encoding]::GetEncoding("UTF-8")
$sr = New-Object System.IO.StreamReader($st, $enc)
$html = $sr.ReadToEnd()
$sr.Close()
$html
#参考
#http://blog.livedoor.jp/morituri/archives/54091235.html
フィールド設定 [SMPS::Result; SMPS_Exe( SMPS::Script )]
例:2
SMPS_Exe( Script )
より
SMPS_ExecSync( Script )
の方が高速です。
スクリプトの記述例は、以下になります。
[code]
変数を設定 [$PS; 値:
Let([
¢PS="
$wc = New-Object System.Net.WebClient;
$url = '{url}';
$st = $wc.OpenRead($url);
$enc = [System.Text.Encoding]::GetEncoding(\"UTF-8\");
$sr = New-Object System.IO.StreamReader($st, $enc);
$html = $sr.ReadToEnd();
$sr.Close();
$html;
"
];
Substitute ( ¢PS ; "{url}" ; WebScan::url )
)
]
変数を設定 [$Result; 値:SMPS_ExecSync( $PS )]
フィールド設定 [WebScan::Source; $Result]
[/code]
※「WebScan::url」URLが記述されているフィールド