如何将webbrowser GetElementById添加到datagridview1 [英] how to get webbrowser GetElementById to datagridview1

查看:149
本文介绍了如何将webbrowser GetElementById添加到datagridview1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码,但..all数据转到datagridview column1。

我需要一个column2和第3列

rowelem.innertext第一列数据第1列第二个数据第2列和第3列数据3

谢谢





尝试

Dim elem作为HtmlElement = WebBrowser1.Document.GetElementById(test1)

Dim count As Integer = 0

For EachElem As HtmlElement in elem.GetElementsByTagName(td)' 13 adet

试试



DataGridView1.Rows.Add(rowElem.InnerText)

Catch ex As Exception



结束尝试

下一页



'MessageBox.Show(count.ToString ())

Catch exc As ArgumentOutOfRangeException

结束尝试

I am using this code but ..all data goto datagridview column1.
I am need a column2 and column 3
rowelem.innertext firs data column 1 second data column 2 and third data column3
thanks


Try
Dim elem As HtmlElement = WebBrowser1.Document.GetElementById("test1")
Dim count As Integer = 0
For Each rowElem As HtmlElement In elem.GetElementsByTagName("td") '13 adet
Try

DataGridView1.Rows.Add(rowElem.InnerText)
Catch ex As Exception

End Try
Next

'MessageBox.Show(count.ToString())
Catch exc As ArgumentOutOfRangeException
End Try

推荐答案

这是我的账单erver ...自动化

表单加载

WebBrowser1.Navigate(d:\ a.html)
this is my billing server ...automation
form load
WebBrowser1.Navigate("d:\a.html")


这篇关于如何将webbrowser GetElementById添加到datagridview1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆