Home > Forum Home > Automating Data Analysis Tasks > How to pull data from webpage(.aspx) for a excel column? > Pull data from .aspx page for a excel column Share

Pull data from .aspx page for a excel column

Excel Help for Pull Data From .aspx Page For A Excel Column in Automating Data Analysis Tasks


Forum TopicLogin

Pull Data From .aspx Page For A Excel Column

Rate this:
(3/5 from 1 vote)
ConfusedHello friends,

VBA Code:
Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)

End Sub

Sub Pull_Status()
Dim iLastRow As Integer
Dim Rng As Range
Dim Txt As String

Me.WebBrowser1.navigate "http://124.124.193.235/eregister/viewdetails.aspx"

While Me.WebBrowser1.Busy Or Me.WebBrowser1.ReadyState <> 4
DoEvents
Wend

iLastRow = Cells(Rows.Count, "a").End(xlUp).Row
For Each Rng In Range("a2:a" & iLastRow)
If Not Rng.Value = vbNullString Then
Rng.Select
Me.WebBrowser1.Document.getElementById("applNumber").Value = Rng.Value
Me.WebBrowser1.Document.getElementById("btnView").Click
x = vbNullString
Do
On Error Resume Next
x = Me.WebBrowser1.Document.getElementsByTagName("td")(0).innerHTML
On Error GoTo 0
DoEvents
Loop While x <> "(NOT FOR LEGAL USE)"
For i = 0 To Me.WebBrowser1.Document.getElementsByTagName("td").length
If Me.WebBrowser1.Document.getElementsByTagName("td")(i).innerHTML Like "*Status*" Then
Txt = Me.WebBrowser1.Document.getElementsByTagName("td")(i).innerHTML
Exit For
End If
Next
Txt = StripHTML(Txt)
Txt = Replace(Txt, " ", vbNullString)
Txt = Replace(Txt, "Status :", vbNullString)

ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Txt
Me.WebBrowser1.navigate "http://124.124.193.235/eregister/viewdetails.aspx"
While Me.WebBrowser1.Busy Or Me.WebBrowser1.ReadyState <> 4
DoEvents
Wend

End If
Next Rng

End Sub

Thanks a lot
Kynthia Melissa
 Posted by on
 
View Full Post

Find relevant Excel templates and add-ins for Pull data from .aspx page for a excel column in the