03-01-2012, 15:13
Visual Basic
- Sub Get_Table_From_HTML()
- 'Dim doc As New HTMLDocument ' Microsoft HTML Object Library
-
- Set HTTP = CreateObject("MSXML2.XMLHTTP")
- Set doc = CreateObject("HTMLFile")
-
- HTTP.Open "get", _
- "https://www.isbank.com.tr/fiyatoran/FiyatTabloGoster.asp?trkd=*YTF&tip=HTML", False
- HTTP.send
-
- doc.write (StrConv(HTTP.responsebody, vbUnicode))
-
- Set tbl = doc.getElementsByTagName("table").Item(0)
-
- For i = 0 To tbl.Rows.Length - 1
- For j = 0 To tbl.Rows(i).Cells.Length - 1
- Debug.Print tbl.Rows(i).Cells(j).innerText
- Next
- Next
-
- Set tbl = Nothing
- Set doc = Nothing
- Set HTTP = Nothing
- End Sub

