Wsw_PreProcessPage

Top  Previous  Next

Sub Wsw_PreProcessPage(Handle, ByRef sMemWeb, ByRef sStatusMessage, ByRef iStatusCode)

 

This function is called immediately after a page has been downloaded and before any other processing starts. This function can be used to modify the page source or even to convert it into another format.

 

Parameters

 

Handle ... Bookmark handle.
sMemWeb ... String expression. Memory string of the page source.
sStatusMessage ... String expression. The assigned text will be displayed in the status column of the bookmark.
iStatusCode ... Integer value. Returns the success status of that function.

 

Valid values of iStatusCode:

0 ...

OK.

Default value, must not be assigned manually.

2 ...

Error.

If 2 is returned, then the check of that bookmark will be aborted and the text assigned to sStatusMessage will be displayed in the status column.

 

Example:

Sub Wsw_PreProcessPage(Handle, ByRef sMemWeb, ByRef sStatusMessage, ByRef iStatusCode)

 

 Dim nStart, nLen

 

   ' Exit if no session ids are available (small performance improvement)

   If InStr("sid=", sMemWeb) = 0 Then

      Exit Sub

   End If

 

   ' Remove all session ids found in the page source

   Do While FindRegex(sMemWeb, "&(amp;)*sid=[a-z,0-9]*", nStart, nLen)

      Delete(sMemWeb, nStart, nLen)

   Loop

End Sub




Translate document: