Парсинг HTML c IHTMLDocument2
Подскажите как извлечь "8 Марта" из класса "second_class"
Procedure TMainForm.Button1Click(Sender: TObject);
Var
html, ClassNameStr: String;
i: Integer;
Element: IHTMLElement;
idoc: IHTMLDocument2;
V: OleVariant;
Begin
html :=
'<div class="first_class">Вчера</div> <time class="second_class" datetime="2020-02-20">8 марта</time>';
V := VarArrayCreate([0, 0], varVariant);
V[0] := html;
idoc := CoHTMLDocument.Create As IHTMLDocument2;
idoc.write(PSafeArray(System.TVarData(V).VArray));
For i := 0 To idoc.all.length - 1 Do
Begin
Element := idoc.all.item(i, 0) As IHTMLElement;
ClassNameStr := Element._className;
If Element._className = 'first_class' Then
Begin
Label1.Text := Element.innerText;
End;
If Element._className = 'second_class' Then
Begin
Label2.Text := Element.innerText;
End;
End;
End;