Let me explain: how many times is the word "<script>" contained in an html page?
Thanks!


Code: Select all
var
i, c: Integer;
text, search: string;
begin
c := 0;
i := 0;
text := '... your text where you want to search ...';
search := '<script>';
while True do
begin
i := Pos(search, text);
if i = 0 then
break;
c := c + 1;
text := Copy(Text, i + Length(search), Length(text));
end;
end;
where numero_episodi is the number i'm lookin for!Procedure..........
var
stringa, pulisci_episodi : string;
numero_episodi, length_all_episodi, length_value_puliti: integer;
begin
length_all_episodi := length(Page);
distanzia_episodi :=('<div class="linea_alboita">');
pulisci_episodi := stringreplace(Page, stringa, '');
length_value_puliti := length (page) - length(pulisci_episodi);
numero_episodi := length(stringa);
numero_episodi := length_value_puliti div numero_episodi; //div è la divisione!
Value := '';
end;