$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
Mostrar el último precio, la fecha y la hora de varias acciones del IBEX 35 (creando un ArrayList en PowerShell con todos los valores obtenidos) (PowerShell, Mercados y cotizaciones)
Except where otherwise noted, Jesusninoc by Jesús N. is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.