DownloadPageToString

Top  Previous  Next

function DownloadPageToString(Handle, sUrl As String, sReferer As String, ByRef sMem) As Integer

 

Downloads the page HTML source of the given URL to the string sMem.

 

Parameters

 

Handle ... Bookmark-Handle that is passed to the Event function.
sUrl ... Address of the page that should be downloaded.
sReferer ... URL from which the page is accessed. This parameter is empty in most cases except the server requires that field.
sMem ... String. Source code of the downloaded page.

 

Return value

 

This function returns the status code that is sent by the server. If no errors happened, this value is typically 200

 

Here's a list of typical return values:

200 OK
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
303 See Other
304 Not Modified
305 Use Proxy
400 Bad Request
401 Unauthorized / Authentication failure
402 Payment Required
403 Forbidden
404 Page Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Time-out
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Request Entity Too Large
414 Request-URI Too Large
415 Unsupported Media Type
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Time-out
505 HTTP Version not supported

 

Example:

Dim sMem

 

if DownloadPageToString(Handle, "http://www.domain.com", "", sMem) = 200 then

   if sMem <> "" then

      ' further actions, sMem contains the page source

   End If

End If




Translate document: