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