1.取页面内容
var
dd:IHTMLDocument2;
oo:IHTMLElement;
idhttp: TIdHttp;
begin
dd := wb1.Document as IHTMLDocument2;
oo := dd.body as IHTMLElement; //不包括head部分,有可能出现乱码问题
idhttp := TIdHttp.Create(self);
string := idhttp.Get(weburl); //取到的页面信息包括head部分
end
----------------------------------------------------------------------------------------------------
2.取input控件,textarea控件里的值
var
idoc:IHTMLDocument2;
OV:OleVariant;
sInputText:IHTMLInputTextElement;
sTexta:IHTMLTextAreaElement;
begin
OV := 0;
idoc := wb1.Document as IHTMLDocument2;
//现在有一个<input id="hf_subject" name="hf_subject" value="1111">
//item使用的是name还是id得验证
sInputText := idoc.all.item('HF_Subject', OV) as IHTMLInputTextElement;
//sInputText := '1111'
end;