VB中WebBrowser控件运用 自动获取网页表格数据 网页表格内容自动提取 VB源码

上传者: renxxx123 | 上传时间: 2019-12-21 20:59:58 | 文件大小: 30KB | 文件类型: rar
'此代码发布后,可随意改哈,欢迎光临我的网址导航网站 http://www.97tt.org Private Declare Function ShellExecute Lib "shell32.dll" Alias _ "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, _ ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Private Sub Command1_Click() Unload Me End Sub Private Sub Command2_Click() On Error Resume Next RichTextBox1.Text = "" Dim Tables As IHTMLElementCollection Set Tables = WebBrowser1.Document.getElementsByTagName("Table") Dim Table1 As HTMLTable Dim Row As HTMLTableRow, Cell As HTMLTableCell For Each Table1 In Tables 'Next For i = 1 To Table1.rows.length - 2 ' 逐行处理 Set Row = Table1.rows(i) j = 0 For Each Cell In Row.cells ' 逐列处理 RichTextBox1.Text = RichTextBox1.Text + Trim(Row.cells(j).innerText) + "," j = j + 1 Next ' 一行处理完毕后,去除行尾的逗号并加上回车 RichTextBox1.Text = Left(RichTextBox1.Text, Len(RichTextBox1.Text) - 1) + vbCrLf Next Next End Sub

文件下载

资源详情

[{"title":"( 5 个子文件 30KB ) VB中WebBrowser控件运用 自动获取网页表格数据 网页表格内容自动提取 VB源码","children":[{"title":"Form1.frm <span style='color:#111;'> 4.67KB </span>","children":null,"spread":false},{"title":"工程3.vbp <span style='color:#111;'> 1.35KB </span>","children":null,"spread":false},{"title":"工程3.vbw <span style='color:#111;'> 53B </span>","children":null,"spread":false},{"title":"Form1.frx <span style='color:#111;'> 29.34KB </span>","children":null,"spread":false},{"title":"网页表格获取.exe <span style='color:#111;'> 60.00KB </span>","children":null,"spread":false}],"spread":true}]

评论信息

  • eduedu530 :
    作为参考资料吧,触类旁通。感谢楼主分享
    2019-06-27
  • weixin_43194916 :
    很好,很实用
    2018-10-25
  • hujian198198 :
    主要是用来学习的,受用了
    2018-08-16
  • libaotian12 :
    东西非常好
    2018-02-22
  • areyong :
    程序完整好,具体还要测试
    2017-05-08

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明