OptimizeHtml

Top  Previous  Next

function OptimizeHtml(sPageSource) As String

 

OptimizeHtml optimizes the page source in the following way:

 

Replaces tabs and carriage return line feeds with a blank
Inserts blanks before "<" and after ">"
Replaces duplicate blanks with single blanks

 

This function can be called before extracting specific information from the page source. It's mostly easier to extract information from an optimized source code.

 

Parameters

 

sPageSource ... String expression. Source code of a web page.

 

Example:

Dim s

 

= "The price is<b> 123,50 </b>EUR"

= OptimizeHtml(s)

' returns s = "The price is <b> 123,50 </b> EUR"




Translate document: