Extracting data from website search bar using VBA

Mido624

New Member
Joined
Oct 2, 2019
Messages
1
Hi everyone,

I am trying to extract data from a website using VBA. This is the web site:
https://gmsip.com.pa
But i can not add my range of data to search bar is there any solution to this problem ?

no i want to add IMO numbers for ship in the excel sheet and VBA run them in website and extract result data to the same sheet as in images below :

https://drive.google.com/drive/folders/1aaUjYz5tCvBrOIcFlWJN9uRbs6tWtLHu?usp=sharing
view


Code:
Private Sub Worksheet_Change(ByVal Target As Range) 
   If Target.Row = Range("imo").Row And _
    Target.Column = Range("imo").Column Then
    Dim IE As New InternetExplorer
    IE.Visible = True
    IE.navigate "https://gmsip.com.pa/asi/inspector/incomingVessels?Search%20vessels...=" & Range("IMO").Value
    Do
    DoEvents
    Loop Until IE.readyState = READYSTATE_COMPLETE
    Dim Doc As HTMLDocumnet
    Set Doc = IE.document
     Dim sDD As String
sDD = Trim(Doc.getElementsByClassName("prompt ng-pristine ng-valid ng-touched")(0).innerText)
    MsgBox sDD
    End If
End Sub

 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,223,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

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