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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,214,865
Messages
6,121,988
Members
449,060
Latest member
mtsheetz

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