Sub OptimizeHtml($pageSource As String) As String


OptimizeHtml optimizes the page source as follows:


  • Replaces tabs and carriage return/line feed characters 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 is usually easier to extract information from optimized source code.


Parameters


  • $pageSource ... String expression. Source code of a web page.


Example:

Dim $s

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