0

I try to get the price information from a webpage and save it to an excel cell.link I have found the html parser and created the code below and another question on stackoverflow : link

Sub bee()

Dim doc As HTMLDocument
Dim htmTable As HTMLTable

Set doc = New HTMLDocument
With CreateObject("MSXML2.XMLHTTP")
    .Open "GET", "http://www.bricklink.com/catalogPOV.asp?itemType=S&itemNo=8868&itemSeq=1&itemQty=1&breakType=M&itemCondition=N&incInstr=Y&incParts=Y"
End With

although I do not understand and know how to proceed. can somebody help with this :S ?

Community
  • 1
  • 1
pwghost
  • 33
  • 1
  • 10

1 Answers1

0

I believe there is many different ways to go to make that you want,

Here is one way you could go :)

Sub ParseTable()
Dim htm As Object: Set htm = CreateObject("htmlfile")
Dim tr As Object
    With CreateObject("msxml2.xmlhttp")
        .Open "GET", "http://pastebin.com/raw/BY51yHwd", False
        .send
        htm.body.innerHTML = .responseText
    End With


    For Each tr In htm.getElementsByTagName("tr")
        If Len(tr.ID) > 0 Then MsgBox tr.ID ' msgbox the table row
    Next tr
End Sub

You need to find out which table the content is in, I believe the table name is "tb-main-content"

Here is a link to the example table I made: http://pastebin.com/raw/BY51yHwd

Have a nice day

XsiSecOfficial
  • 954
  • 8
  • 20
  • hi thx for you comment. But on the website i need to do this the tables do not have any id's how should i do it then ? – pwghost Feb 23 '16 at 08:31