PowerShell : Save Html, Body, ….
Voici trois méthodes permettant de sauver une page web ou plus simplement du code html
# Internetexplorer.application
$obj=New-Object -ComObject internetexplorer.application
$obj.visible=$true
$obj.navigate2("http://www.google.com")
while($obj.ReadyState -ne 4){start-sleep -m 100}
$obj.Document.documentElement.outerHTML
# xml http
$url = "http://www.cnn.com"
$xHTTP = new-object -com msxml2.xmlhttp;
$xHTTP.open("GET",$url,$false);
$xHTTP.send();
$xHTTP.ResponseText; # returns the html doc
# net.webclient $url="http://www.cnn.com" $wc = new-object net.webclient $html = $wc.DownloadString($url)
