Opción 1
1 2 3 4 5 6 7 8 9 |
$url='https://www.bing.com/search?q=powershell' $result = Invoke-WebRequest $url $array=@($result.AllElements | Where Class -eq "b_caption").innerText for($i=0;$i -lt $array.Length;$i++) { if($array[$i] -match 'scripting'){ Write-Host 'Encontrado posición: ' ($i+1) `n'Texto: ' $array[$i] } } |
Opción 2
1 |
@((Invoke-WebRequest 'https://www.bing.com/search?q=powershell').AllElements | Where Class -eq "b_caption").innerText | Select-String 'scripting' |