P
pgnzr
Unregistered / Unconfirmed
GUEST, unregistred user!
用IHTMLDocument2和idhttp.get(url);都不行。javascrip显示的部分就得不到。
还是我的用法有问题:
function TForm1.GetHtml(const WebBrowser: TWebBrowser): String;
var
Doc :IHTMLDocument2;
Elements :IHTMLElementCollection;
Item :IHTMLElement;
mLen,i :integer;
begin
Doc := WebBrowser.Document as IHTMLDocument2;
if Doc = nil then Exit;
Elements:= Doc.all as IHTMLElementCollection;
mLen:=Elements.length;
for i:= 0 to mLen - 1 do
begin
Item:=Elements.Item(i,'') as IHTMLElement;
if uppercase(Item.tagName) = 'HTML' then
begin
Result:=Item.Outertext;
Break;
end;
end;
end;
还是我的用法有问题:
function TForm1.GetHtml(const WebBrowser: TWebBrowser): String;
var
Doc :IHTMLDocument2;
Elements :IHTMLElementCollection;
Item :IHTMLElement;
mLen,i :integer;
begin
Doc := WebBrowser.Document as IHTMLDocument2;
if Doc = nil then Exit;
Elements:= Doc.all as IHTMLElementCollection;
mLen:=Elements.length;
for i:= 0 to mLen - 1 do
begin
Item:=Elements.Item(i,'') as IHTMLElement;
if uppercase(Item.tagName) = 'HTML' then
begin
Result:=Item.Outertext;
Break;
end;
end;
end;