1,593
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.Button3Click(Sender: TObject);
var
doc: IHTMLDocument2;
mDiv: IHTMLDivElement;
mm: IHTMLElement;
Dispatch: IDispatch;
i: integer;
begin
doc := wb1.Document as IHTMLDocument2;
for i:=0 to doc.all.length-1 do
begin
Dispatch := doc.all.item(i,0);
if succeeded(Dispatch.QueryInterface(IHTMLDivElement,mDiv)) then
begin
mm := Dispatch as IHTMLElement;
if Pos('mod ',mm.className)>0 then
begin
showmessage(mm.getAttribute('data-mod-config',0));
mm.setAttribute('data-mod-config','aaa',0);
showmessage(mm.getAttribute('data-mod-config',0));
end;
end;
end;
end;