打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
DELPHI自动分析表单(WebBrowser)

DELPHI自动分析表单(WebBrowser)

//-----先创建一个WebBrowser,以及自己Negative,也就是先打开一个页面
///----------------stringgrid初始化-------------
procedure TForm1.stringCreate(StringGrid: TStringGrid);
begin
StringGrid.Cells[0, 0] := '序号 ';
StringGrid.Cells[1, 0] := 'ID号 ';
StringGrid.Cells[2, 0] := '类别 ';
StringGrid.Cells[3, 0] := '类型 ';
StringGrid.Cells[4, 0] := '名称 ';
StringGrid.Cells[5, 0] := '数值 ';
end;

----------------取得一个页面的可能的按键信息0------------------
function TForm1.GetAll(web: TWebBrowser): Boolean;
var
n, m: Integer;
Myweb: OleVariant;
begin
Myweb := web.Document;
m := 1;
for n := 0 to Myweb.all.length -1 do // A编历所有的元素
begin
try
if Myweb.All.item(n).type = 'hidden' then //跳过隐藏不可用的类型
Continue;
except
continue;
end;
StringGrid1.Cells[0, n] := IntToStr(m);
StringGrid1.Cells[1, n] := IntToStr(n);
StringGrid1.Cells[2, n] := Myweb.All.item(n).tagname;
StringGrid1.Cells[3, n] := Myweb.All.item(n).type;
try
StringGrid1.Cells[4, n] := Myweb.All.item(n).Name;
StringGrid1.Cells[5, n] := Myweb.alL.item(n).value;
except

end;
StringGrid1.RowCount := StringGrid1.RowCount + 1; //对stringGrid添加新的一行
m := m + 1;
end;
end;
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
DELPHI如何将数据导出到指定格式的EXCEL模版
Delphi与Excel的亲密接触--Lark工作室
利用Delphi TStringGrid控件实现日历排程
Delphi StringGrid常用属性和常用操作
Delphi文件 FileOpen 、FileSeek等的用法
引用 Delphi操作EXCEL 根据别人的组件改写的支持ADO
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服