VBA web data scraping from table

fotodj

New Member
Joined
Jul 19, 2014
Messages
27
Code:
Sub Scrambledata()


    Dim ie As Object, objInputs As Object


    Set ie = CreateObject("InternetExplorer.Application")
    ie.Visible = True
    ie.Navigate "http://www.scramble.nl/military-database/usaf"


    Do While ie.ReadyState <> 4: DoEvents: Loop


    
    ie.Document.getElementById("serial").Value = Sheets("Scramble").Range("A2").Value


   
    Set objInputs = ie.Document.getElementsByTagName("input")
    For Each ele In objInputs
        If ele.Name Like "sbm" Then
            ele.Click
            Exit For
        End If
    Next
    
    
    
    
     End Sub

scr.JPG


I have a value in cell A2 = 03-3114, code above is searching website for that input and returns with results in a table
I am trying to scrape that data back into excel cell, I tried few different ways but so far I have not found working solution

Search for serial 03-3114 returns type = C-17A (third field in the table)
I'd like to import that value into my table in to cell B2,

I was able to find xPath using Firefox Firebug but I dont know what to do next

/html/body/div[1]/div/div[2]/div/div[2]/div[5]/div[2]/div[1]/table/tbody/tr[3]/td[3]/span


any help/hint is appreciated.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,214,923
Messages
6,122,286
Members
449,076
Latest member
kenyanscott

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top