1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
$acciones = "ES0148396007","ES0113900J37","ES0109067019","ES0105046009","ES0105066007","ES0130960018","ES0130670112","ES0118900010","ES0171996087","ES0177542018","ES0144580Y14","ES0169501022","ES0173516115","ES0165386014","ES0178430E18" $arraylist = New-Object System.Collections.ArrayList foreach($accion in $acciones) { $web = (Invoke-WebRequest ('http://www.bolsamadrid.es/esp/aspx/Empresas/FichaValor.aspx?ISIN='+$accion)) $webhtml = $web.AllElements.where{$_.id -eq "ctl00_Contenido_tblPrecios"}.outerhtml $sinhtml = $webhtml.replace(".","").replace(",",".").replace("",",").replace("",",") -replace "<.*?>" $htmlsin = $sinhtml.trim() $sinespa = $htmlsin.replace(" ","") $Params = @{ MemberType = 'NoteProperty' Name = 'Título' Value = $web.ParsedHtml.title } $concsv = $sinespa | ConvertFrom-Csv $concsv | Add-Member @Params [void]$arraylist.Add($concsv) } $arraylist | select título,fecha,hora,últ | Format-Table |