Sub PullFromInternet()
'The web address at which xml is stored
URL = "http://jjh.virtual.vps-host.net:8080/restdemo/services/customers/0"
Dim HttpReq As Object
'Declare the request for information over the internet
Set HttpReq = New WinHttpRequest
'Specify the type of HTTP request
HttpReq.Open "GET", URL, False
'or use GET instead of POST
'Specify the type of content that can be recieved
HttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
'Send the actual request
HttpReq.Send
'HttpReq.send postmydata
'Note - if using GET set postmydata to ""
Dim response As String
Dim tag As String
Dim data As String
tag = "address"
response = HttpReq.ResponseText
MsgBox (extractor(tag, response))
End Sub
Function extractor(tag As String, response As String) As String
Dim tagLength As Integer
Dim mypos As Integer
Dim myposEnd As Integer
mypos = InStr(1, response, "<" & tag)
myposEnd = InStr(1, response, "<" &"/" & tag)
tagLength = Len(tag) + 2
Dim address As String
extractor = Mid(response, mypos + tagLength, (myposEnd - mypos - tagLength))
End Function
Monday, October 26, 2009
XML Extractor
Subscribe to:
Post Comments (Atom)
Top Level Statements in C#
C# Top-Level Statements vs. Main Method C# Top-Level Statements vs. Main Method In C# 9 and later, you can use ...
-
In a regular annotation note, create a stack that looks the way you like. It will take a couple of trial and error attempts since there...
-
Getting into Equation Mode use <alt> and = to get into the equation editor. Radicals : $\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$ ...
No comments:
Post a Comment