#すみません。このスレお借りします。1レスのみです


#コマンドラインで実行するとき → powershell -ExecutionPolicy RemoteSigned -File <このファイル名>
function findurl([string]$orgurl) {
$wc=New-Object System.Net.WebClient
$wc.Encoding = [System.Text.Encoding]::UTF8
$source=$wc.DownloadString($orgurl)
if ($source -match '(http://(.*?).yamvideo.com/[^"]+)"'){
return $Matches[1]
}
return "";
}

$word=Read-Host "検索ワード"
for($num=1; $num -lt 100; $num++){
$url="https://www.erogravity.jp/page/$num/?s=$word";
$wc=New-Object System.Net.WebClient
$wc.Encoding = [System.Text.Encoding]::UTF8
try
{
$source=$wc.DownloadString($url)
$lines = $source -split "\n"
foreach($line in $lines){
if($line -match '<h2 class="archive-header-title">'){
$line -match '^.*?<a href="([^"]+)">([^<]+)'| Out-Null
$sturl = findurl($Matches[1])
if ($sturl.Length -lt 1) { continue }
$title = $Matches[2]
$sturl+" "+$title
}#fi
}#for-each
}#try
catch [System.Net.WebException] # 404
{
$dummy=Read-Host "push ENTER to exit" #puase
exit
}#catch
}# for-loop($num)