Need Help : Data Scraping from Website
hi,
i am trying to get data from website into excel, but i am facing problem, can you please help me here is my 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
please help me to solve this problem, i am also uploading my excel file.
thanks in advance.
Attachment | Size |
---|---|
Book1.xlsm | 41.2 KB |
Web scrapping
hello sir
i have created the macro for extracting the data from the web site, any how am not able to attach my file here because i don't see any attach file option here . just give me your mail id so that i can send it to your mail box
thanks