Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 从标记之间的网页获取信息_Vb.net - Fatal编程技术网

Vb.net 从标记之间的网页获取信息

Vb.net 从标记之间的网页获取信息,vb.net,Vb.net,因此,我试图从位于标记之间的网页中获取一些文本。我已经包括了一个图像,显示了我试图获得的文本。 我目前拥有的代码如下,尽管它也在收集其他不需要的信息 For Each ele As HtmlElement In WebBrowser1.Document.All If ele.GetAttribute("className").ToLower.Contains("cwybtn") Then Dim colourSource As String = ele.

因此,我试图从位于标记之间的网页中获取一些文本。我已经包括了一个图像,显示了我试图获得的文本。

我目前拥有的代码如下,尽管它也在收集其他不需要的信息

For Each ele As HtmlElement In WebBrowser1.Document.All
        If ele.GetAttribute("className").ToLower.Contains("cwybtn") Then
            Dim colourSource As String = ele.GetAttribute("innerText")
            'ListBox2.Items.Add(colourSource) 'Adds all .jpg images to the ListBox
            MsgBox(colourSource)
        End If
    Next

有人有什么想法吗?为什么不试试tagName?您有一个来自类名的元素,请尝试从该元素中获取该元素作为标记名
希望这将有助于getElementsByTagNamestrong

为什么不尝试使用tagName?您有一个来自类名的元素,请尝试从该元素中获取该元素作为标记名 希望这将有助于getElementsByTagNamestrong

谢谢你!老实说,我已经把它修好了

For Each strongTag As HtmlElement In WebBrowser1.Document.GetElementsByTagName("strong")
            MsgBox(strongTag.InnerText)
        Next
安基特

谢谢你!老实说,我已经把它修好了

For Each strongTag As HtmlElement In WebBrowser1.Document.GetElementsByTagName("strong")
            MsgBox(strongTag.InnerText)
        Next