procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var
URL: OleVariant);
var iDoc: IHtmlDocument2;
i: integer;
ov: OleVariant;
iDisp: IDispatch;
iColl: IHTMLElementCollection;
iInputElement: IHTMLInputElement;
begin
WebBrowser1.ControlInterface.Document.QueryInterface(IHtmlDocument2, iDoc);
if not assigned(iDoc) then begin
ShowMessage('Keine Webseite geladen');
Exit;
end;
ov := 'INPUT';
IDisp := iDoc.all.tags(ov);
if assigned(IDisp) then begin
IDisp.QueryInterface(IHTMLElementCollection, iColl);
if assigned(iColl) then begin
for i := 1 to iColl.Get_length do begin
iDisp := iColl.item(pred(i), 0);
iDisp.QueryInterface(IHTMLInputElement, iInputElement);
if assigned(iInputElement) then begin
if iInputElement.Get_value='18'
then iInputElement.checked:=true ;
end;
end;
end;
end;
end;