Hi guys,
i was looking a macro to fetch table from http://www.flipkart.com/canon-powers...f-5af8eb547815 and i did but the data fetch by the macro saves in single row. I want the table in the same format.
I tried many things but didnt work.
This is the script im using
Sub Extract_TD_text()
Dim URL As String
Dim IE As InternetExplorer
Dim HTMLdoc As HTMLDocument
Dim TDelements As IHTMLElementCollection
Dim TDelement As HTMLTableCell
Dim r As Long
URL = Range("sURL")
Set IE = New InternetExplorer
With IE
.navigate URL
.Visible = True
'Wait for page to load
While .Busy Or .readyState <> READYSTATE_COMPLETE: DoEvents: Wend
Set HTMLdoc = .document
End With
Set TDelements = HTMLdoc.getElementsByTagName("table")
r = 0
For Each TDelement In TDelements
'Look for required TD elements - this check is specific to VBA Express forum - modify as required
If TDelement.className = "fk-specs-type2" Then
Sheet1.Range("A2").Offset(r, 0).Value = TDelement.innerText
r = r + 1
End If
Next
End Sub
Thanks in Advance
-
AND I KNOW ITS EASY FOR YOU GUYS & IM JUST A NOOB
Bookmarks