以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]抓取网页显示脚本错误如何处理?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=81116)

--  作者:dqlgood
--  发布时间:2016/2/18 20:37:00
--  [求助]抓取网页显示脚本错误如何处理?
Dim web As new System.Windows.Forms.WebBrowser
web.Navigate("http://vip.stock.finance.sina.com.cn/q/go.php/vDYData/kind/znzd/index.phtml")
Do Until web.ReadyState = 4
    Application.DoEvents
Loop
Dim trs = web.Document.GetElementsByTagName("tr")
For i As Integer = 2 To trs.count - 1
    Dim str As String = ""
    Dim tds = trs(i).GetElementsByTagName("td")
    For j As Integer = 0 To tds.count - 1
        str &= tds(j).InnerText & "   "
    Next
    output.show(str)
Next
显示

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20160218202953.png
图片点击可在新窗口打开查看
如何处理?

[此贴子已经被作者于2016/2/18 20:38:44编辑过]

--  作者:大红袍
--  发布时间:2016/2/18 20:41:00
--  
Dim web As new System.Windows.Forms.WebBrowser
web.ScriptErrorsSuppressed = True
web.Navigate("http://vip.stock.finance.sina.com.cn/q/go.php/vDYData/kind/znzd/index.phtml")
Do Until web.ReadyState = 4
    Application.DoEvents
Loop
Dim trs = web.Document.GetElementsByTagName("tr")
For i As Integer = 1 To trs.count - 1
    Dim str As String = ""
    Dim tds = trs(i).GetElementsByTagName("td")
    For j As Integer = 0 To tds.count - 1
        str &= tds(j).InnerText & "   "
    Next
    output.show(str)
Next