$request = [System.Net.WebRequest]::Create("http://mojeinwestycje.interia.pl/gie/notgpw/full/zlec_all?sp=125&zl=A") $response = $request.GetResponse() $requestStream = $response.GetResponseStream() $readStream = new-object System.IO.StreamReader $requestStream $linie=$readStream.ReadToEnd() $readStream.Close() $response.Close() $linie = $linie.split("`n") $linie | foreach { if ($_ -match "(\d.*)<\/code>") { $linia = $matches[1] $tabelka=$linia.split("
",[StringSplitOptions]::RemoveEmptyEntries) $ex=new-object -com Excel.Application $ex.visible=$true $wbs=$ex.Workbooks.Add([System.Reflection.Missing]::Value) for ($i=1; $i -le $tabelka.length; $i++) { if ($tabelka[$i] -match "(\d,\d\d).*?(\d+) \.* (.*)") { $k = "A" + $i #$a = $ex.ActiveSheet.Range($k).Select() #$ex.ActiveCell.FormulaR1C1 = $matches[1] $a = $ex.Cells($i, "A").Value = $matches[1] $k = "B" + $i $a = $ex.ActiveSheet.Range($k).Select() $ex.ActiveCell.FormulaR1C1 = $matches[2] $k = "C" + $i $a = $ex.ActiveSheet.Range($k).Select() $ex.ActiveCell.FormulaR1C1 = $matches[3] } } } }