HTML网页Table解析
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解析的更多相关文章
- 【SQL篇章】【SQL语句梳理 :--基于MySQL5.6】【已梳理:ALTER TABLE解析】
ALTER TABLE 解析实例: SQL: 1.增加列 2.增加列,调整列顺序 3.增加索引 4.增加约束 5.增加全文索引FULL-TEXT 6.改变列的默认值 7.改变列名字(类型,顺序) 8. ...
- windows phone 7,sliverlight 下载网页的解析,关于wp7 gb2312编码
原文:windows phone 7,sliverlight 下载网页的解析,关于wp7 gb2312编码 关于silverlight和wp7(windows phone 7)是默认不支持gb2312 ...
- 解析ASPX网页__doPostBack分页的网页table数据
由于急于上线的功能要去客服系统里抓取数据进行验证,客服方面又没有时间开发EDI接口给到我,所以用了本办法:爬人家web系统上的数据进行分析. 由于客服的web系统用ASP.Net的__doPostBa ...
- 20170717_python_爬虫_网页数据解析_BeautifulSoup_数据保存_pymysql
上午废了老大劲成功登陆后,下午看了下BeautifulSoup和pymysql,晚上记录一下 自己电脑装的sublime,字体颜色竟然拷贝不下来 - - 写的过程中遇到了很多问题: 1.模拟登陆部分 ...
- 用Python抓取网页并解析
软件版本 python:2.7.12 网页抓取库 网页抓取库为requests, github地址为:https://github.com/requests/requests, 文档地址为:http: ...
- 爬虫、网页分析解析辅助工具 Xpath-helper
每一个写爬虫.或者是做网页分析的人,相信都会因为在定位.获取xpath路径上花费大量的时间,甚至有时候当爬虫框架成熟之后,基本上主要的时间都花费在了页面的解析上.在没有这些辅助工具的日子里,我们只能通 ...
- 爬虫(6) - 网页数据解析(2) | BeautifulSoup4在爬虫中的使用
什么是Beautiful Soup库 Beautiful Soup提供一些简单的.python式的函数用来处理导航.搜索.修改分析树等功能 它是一个工具箱,通过解析文档为用户提供需要抓取的数据,因为简 ...
- js实现把网页table导成Excel
//导出excel function exportExcel(DivID,strTitle){ if(DivID==null) { return false; } var jXls, myWorkbo ...
- 2.2 Xpath-helper (chrome插件) 爬虫、网页分析解析辅助工具
1. Xpath-helper下载 可以直接在chrome浏览器中的扩展程序搜索 Xpath-helper进行添加 也可以直接在http://www.chromein.com/crx_11654.ht ...
随机推荐
- exec函数簇
转自:http://www.cppblog.com/prayer/archive/2009/04/15/80077.html 也许有不少读者从本系列文章一推出就开始读,一直到这里还有一个很大的疑惑:既 ...
- ssh 免 密码登录另一台机器 和 secureCRT的乱码问题
PS: 就是你把密钥生成好以后,放入B机器中,再登录的时候就已经有了所以就不用验证了 ========================================================= ...
- git代码回退
情况1.还没有push可能 git add ,commit以后发现代码有点问题,想取消提交,用: reset git reset [--soft | --mixed | --hard] eg: gi ...
- kettle的输入输出组件和脚本组件
一. 输入组件 1.1表输入 从指定的数据库中,通过sql语句来查询数据加载到内存. 允许简易转换:勾选后可以避免不必要的字段的数据类型转换,从而提高性能. 替换sql语句里的变量:勾选后可以通过${ ...
- vue-cli 构建项目中 config/index.js 文件解读
// see http://vuejs-templates.github.io/webpack for documentation. var path = require('path') module ...
- jQuery与DOM对象的转换
一.jQuery与DOM对象的转换. 1.jQuery对象转换为DOM对象:$cr[0] 或 $cr.get(0) $cr为jQuery对象 2.DOM对象转换为jQuery对象:$(cr) cr为D ...
- pbuf类型和应用
下面的讨论仅限于RAW API. 按存储方式分类 1. PBUF_RAM 从一般性的Heap中分配.可用空间大小受MEM_SIZE宏控制.可看作一般意义上的动态内存. 用途: a) 将应用层中的待发送 ...
- 【FusionCharts学习-2】第一个FusionCharts程序
获取资源 到官网:http://www.fusioncharts.com/download/ 获取FusionCharts文件: 目录结构: js目录下的文件: 创建项目 1. 项目名称:Fusion ...
- oracle学习操作(1)
一.oracle表及表空间: 1.查看用户.用户表空间等,需要sysdba登陆: select username, default_tablespace from dba_users; 2.一个数 ...
- jmeter监控服务器的方法
先下载Jmeter资源监控插件,我的百度云jmeter视频里面有说. 地址如下: JMeterPlugins-Standard-1.3.1.zip 下载 https://jmeter-plugins ...