I have this website "http://dgftcom.nic.in/licasp/sbdetformnew.asp" , where in i need to enter IEC code - against which i have different Ports to select from(this is where i'm finding difficulty), and then the Shipping bill needs to be entered below(again taken from excel)
IEC Code
0392032449
0392032449
Port
INBOM4(Bombay Air Cargo)
INNGP6 Nagpur
Shipping Bill no
3963373
3954544
I have written the code, but finding it difficulty at selecting those port names.
Option Explicit
Public Sub Shippingdetails() ' Entering IEC code and port number
Dim bot As WebDriver
Dim count As Long
Set bot = New WebDriver
bot.Start "Chrome"
count = 1
While (Len(Range("A" & count)) > 0)
bot.Get "http://dgftcom.nic.in/licasp/sbdetformnew.asp"
bot.FindElementByXPath("//input[@type='text'][@name='D5']").SendKeys Range("A" & count)
bot.FindElementByXPath("//*[@id='AutoNumber1']/tbody/tr[7]/td[3]/font").AsSelect.SelectByText Range("B" & count)
bot.FindElementByXPath("//input[@type='text'][@name='T5']").SendKeys Range("C" & count)
bot.FindElementById("button1").Click
Range("D" & count) = bot.FindElementByXPath("//html/body/div/center/div/table[4]/tbody/tr[2]/td[7]/font").Text
'Range("E" & count) = bot.FindElementByCss("table td[8], table + font").Text
Range("E" & count) = bot.FindElementByXPath("/html/body/div/center/div/table[4]/tbody/tr[2]/td[8]/font/b")
'bot.Wait 1000
count = count + 1
Wend
bot.Quit
End Sub
Ultimately i need to extract the "File no and date" & "Status". Please help me out.
No Shipping Bill details available for Shipping Bill Number : 3963373 Please Check Port Code / IEC / SB Number for Correctness.