procedure TForm27.Button1Click(Sender: TObject);
var
doc2: IHTMLDocument2;
doc3: IHTMLDocument3;
itableCollection, emtCollection: IHTMLElementCollection;
itable: IHTMLTABLE;
emt: IHTMLElement;
tabrow: IHTMLTableRow;
tabsec: IHTMLTableSection;
I, J, K: integer;
sid, s1, s2, s3, s4, s5, sText: string;
begin
ListBox1.Clear;
WebBrowser1.Navigate('http://zx.caipiao.163.com/trend/11xuan5/?beginPeriod=14092901&endPeriod=14100875&selectDate=4');
while WebBrowser1.Busy do
Application.ProcessMessages; doc2 := self.WebBrowser1.Document as IHTMLDocument2;
doc3 := WebBrowser1.Document as IHTMLDocument3;
itableCollection := doc2.all.tags('table') as IHTMLElementCollection; for I := to itableCollection.Length - do
begin
itable := itableCollection.item(I, ) as IHTMLTABLE;
emt := itable as IHTMLElement; if emt.id = 'chartsTable' then
begin
emt := itable.tBodies.item(, ) as IHTMLElement; // tbody cpdata
tabsec := emt as IHTMLTableSection;
tabsec.rows.Length; for J := to tabsec.rows.Length - do
begin
tabrow := tabsec.rows.item(J, ) as IHTMLTableRow;
if tabrow.cells.Length < then
Continue;
sid := (tabrow.cells.item(, ) as IHTMLElement).innerText; //
s1 := (tabrow.cells.item(, ) as IHTMLElement).innerText; //
s2 := (tabrow.cells.item(, ) as IHTMLElement).innerText; //
s3 := (tabrow.cells.item(, ) as IHTMLElement).innerText; //
s4 := (tabrow.cells.item(, ) as IHTMLElement).innerText; //
s5 := (tabrow.cells.item(, ) as IHTMLElement).innerText; //
sText := Format('%s %s %s %s %s %s', [sid, s1, s2, s3, s4, s5]);
ListBox1.Items.Add(sText);
end;
end;
end;
end;

HTML网页Table解析的更多相关文章

  1. 【SQL篇章】【SQL语句梳理 :--基于MySQL5.6】【已梳理:ALTER TABLE解析】

    ALTER TABLE 解析实例: SQL: 1.增加列 2.增加列,调整列顺序 3.增加索引 4.增加约束 5.增加全文索引FULL-TEXT 6.改变列的默认值 7.改变列名字(类型,顺序) 8. ...

  2. windows phone 7,sliverlight 下载网页的解析,关于wp7 gb2312编码

    原文:windows phone 7,sliverlight 下载网页的解析,关于wp7 gb2312编码 关于silverlight和wp7(windows phone 7)是默认不支持gb2312 ...

  3. 解析ASPX网页__doPostBack分页的网页table数据

    由于急于上线的功能要去客服系统里抓取数据进行验证,客服方面又没有时间开发EDI接口给到我,所以用了本办法:爬人家web系统上的数据进行分析. 由于客服的web系统用ASP.Net的__doPostBa ...

  4. 20170717_python_爬虫_网页数据解析_BeautifulSoup_数据保存_pymysql

    上午废了老大劲成功登陆后,下午看了下BeautifulSoup和pymysql,晚上记录一下 自己电脑装的sublime,字体颜色竟然拷贝不下来 - - 写的过程中遇到了很多问题: 1.模拟登陆部分 ...

  5. 用Python抓取网页并解析

    软件版本 python:2.7.12 网页抓取库 网页抓取库为requests, github地址为:https://github.com/requests/requests, 文档地址为:http: ...

  6. 爬虫、网页分析解析辅助工具 Xpath-helper

    每一个写爬虫.或者是做网页分析的人,相信都会因为在定位.获取xpath路径上花费大量的时间,甚至有时候当爬虫框架成熟之后,基本上主要的时间都花费在了页面的解析上.在没有这些辅助工具的日子里,我们只能通 ...

  7. 爬虫(6) - 网页数据解析(2) | BeautifulSoup4在爬虫中的使用

    什么是Beautiful Soup库 Beautiful Soup提供一些简单的.python式的函数用来处理导航.搜索.修改分析树等功能 它是一个工具箱,通过解析文档为用户提供需要抓取的数据,因为简 ...

  8. js实现把网页table导成Excel

    //导出excel function exportExcel(DivID,strTitle){ if(DivID==null) { return false; } var jXls, myWorkbo ...

  9. 2.2 Xpath-helper (chrome插件) 爬虫、网页分析解析辅助工具

    1. Xpath-helper下载 可以直接在chrome浏览器中的扩展程序搜索 Xpath-helper进行添加 也可以直接在http://www.chromein.com/crx_11654.ht ...

随机推荐

  1. 使用python的Paramiko模块登陆SSH

    使用python的Paramiko模块登陆SSH paramiko是用Python语言写的一个模块,遵循SSH2协议,支持以加密和认证的方式,进行远程服务器的连接. python的paramiko模块 ...

  2. 2017年最新cocoapods安装教程(解决淘宝镜像源无效以及其他源下载慢问题)

    首先,先来说一下一般的方法吧,就是把之前的淘宝源替换成一个可用的的源: 使用终端查看当前的源 gem sources -l gem sources -r https://rubygems.org/ # ...

  3. 关于发现宇宙微波背景(CMB)辐射的一则趣闻

           请看下图:           上图是发现宇宙存在微波背景(CMB)的样子有点怪异的射电望远镜(口径5米,即Holmdel horn antenna天线).该天线具有较好的抗干扰的性能, ...

  4. 使用MQ要考虑的问题

    一般现代软件系统都会用到MQ,几乎所有开发人员也都会想到用MQ,但真正能用好的人估计不多,因为要用好MQ有很多方面问题要考虑: 1.在原直接交互的系统间增加MQ中间层,MQ的性能.可靠程度会严重影响原 ...

  5. [NN] 对于BackPropagation(BP, 误差反向传播)的一些理解

    本文大量参照 David E. Rumelhart, Geoffrey E. Hinton and Ronald J. Williams, Learning representation by bac ...

  6. Nginx隐藏主机信息,proxy_hide_header 与fastcgi_hide_header

    Nginx中proxy_hide_header 与fastcgi_hide_header都可以隐藏主机头信息,两者在具体使用时还是有着一定的区别的.刚好业务使用的nginx反向代理在显示响应头时将后端 ...

  7. URL中的hash(井号)

    1.#的含义 #代表网页中的一个位置,其右边的字符,就是该位置的标识符.比如 http://www.example.com/index.html#print 就是代表index.html中的print ...

  8. OpenWrt在没有Luci时刷机

    scp上传bin文件到root文件夹下. sysupgrade openwrt-ar71xx-generic-dragino2-squashfs-sysupgrade.bin 等待重启

  9. thinkphp3.2用户登录ajax提交验证

    html代码 <if condition="!isset($_SESSION['account'])"> <div class="load lf&quo ...

  10. 服务注册发现Eureka之一:Spring Cloud Eureka的服务注册与发现

    Spring Cloud简介 Spring Cloud是一个基于Spring Boot实现的云应用开发工具,它为基于JVM的云应用开发中的配置管理.服务发现.断路器.智能路由.微代理.控制总线.全局锁 ...