FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to get data for website pages..
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How to get data for website pages.. [message #180280 is a reply to message #180232] Sun, 03 February 2013 20:03 Go to previous message
cate is currently offline  cate
Messages: 12
Registered: January 2012
Karma:
Junior Member
On Feb 1, 5:57 am, Sonu Yadav <sonnu.ya...@gmail.com> wrote:
> Hello friends
>
> I want to write program for get data from website pages..and it will be download in Excel format..How it is possible please help me..

This could be a vba question...


An example:


On Error Resume Next
Dim oHTTP As XMLHTTP: Set oHTTP = CreateObject("Microsoft.XMLHTTP")
If Err = ERR_APP_NOTFOUND Then
MsgBox "Failed CreateObject(""Microsoft.XMLHTTP"")"
GoTo LABEL_GETHTML_EXIT
End If

On Error GoTo 0

'Set getHTML = New DOMDocument60 '
http://msdn.microsoft.com/en-us/library/ms763742%28v=vs.85%29.aspx
'Dim oHTTP As XMLHTTP: Set oHTTP = New XMLHTTP

On Error GoTo label_http_error

Dim randomTime As Variant: randomTime = Now()

url = url & "?killcache=" & """" & randomTime & """" 'kill the
cache
If roach = True Or view_link_data = True Then
MsgBox url, , "Link Update Data"
End If

oHTTP.Open "GET", url, False
oHTTP.Send

On Error GoTo 0

Const HTTP_STATUS_COMPLETED As Integer = 200
If oHTTP.status <> HTTP_STATUS_COMPLETED Then
MsgBox "XMLHTTP failed. Status " & oHTTP.status
GoTo LABEL_GETHTML_EXIT
End If

If roach = True Or view_link_data = True Then
MsgBox oHTTP.responsetext, , "Link Update Data"
End If

'Set getHTML = CreateObject("DOMDocument60") ' why not?
Set getHTML = New DOMDocument60
If Err = ERR_APP_NOTFOUND Then
MsgBox "Failed: CreateObject(""DOMDocument60""). Include a
reference to ""Microsoft XML, V6.0"""
GoTo LABEL_GETHTML_EXIT
End If

getHTML.LoadXML (oHTTP.responsetext)
If getHTML.parseError.ErrorCode <> 0 Then
MsgBox "Failed oDoc.LoadXML"
Set getHTML = Nothing
GoTo LABEL_GETHTML_EXIT
End If
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: cURL
Next Topic: about php connection string
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 14:39:29 GMT 2024

Total time taken to generate the page: 0.04148 seconds