i am facing problem to scrap data from website here is my code.i have TIN no in column A i want Name as per Department record in Column B and status (i.e.Active/Cancel dt) in column C. I need help. PLEASE SOMEBODY HELP ME TO SOLVE MY PROBLEM.
PHP Code:
Sub VerifyVatTinFromMahavat()
Dim RowCount As Long
Dim sht, ele As Object, TIN
Dim objIE
Set sht = Sheets("Sheet1")
RowCount = 1
sht.Range("B" & RowCount) = "Name as per Dept.Record"
sht.Range("C" & RowCount) = "Active/Cancel Dt"
eRow = sht.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Visible = True
.Navigate "http://mahavat.gov.in/Tin_Search/Tinsearch.jsp"
Do While .readyState <> 4
DoEvents
Loop
Set TIN = .document.getelementsbyname("tin")
TIN.Item(0).Value = sht.Range("A2")
.document.getElementById("Submit").Click
Do While .Busy Or .readyState <> 4
DoEvents
Loop
For Each ele In .document.all
Select Case ele.classname
' Case "search-head"
' RowCount = RowCount + 1
Case "Dealer Name"
sht.Range("B" & RowCount) = ele.innertext
Case "STATUS"
sht.Range("C" & RowCount) = ele.innertext
End Select
Next
End With
Set objIE = Nothing
End Sub
Bookmarks