program CountURL; // Sample script to count the number of Urls in a web page const SearchFor = 'http://'; var str : string; nPos, nCount : integer; procedure OnDocumentComplete(URL : string); begin if IsPartOf('c:\temp\Info_PA_TARGET.htm', URL) then begin str := GetHTMLBody; nPos := Pos(SearchFor, str); while (nPos > 0) do begin nCount := nCount + 1; Delete(str, nPos, length(SearchFor)); nPos := Pos('http://', str); end; ShowMessage('Number of Urls: '+IntToStr(nCount)); end; end; begin nCount := 0; Navigate('c:\temp\Info_PA_TARGET.htm'); end.