要求:提取文本"Lossless“。
<td nowrap="nowrap" align="center">
<span class="gen">4:59<br /><span style="color: red">Lossless</span></span>
</td>我只能通过以下方式提取整个文本“4:59 59Lossless”:
Dim divnodes As HtmlNode = doc.DocumentNode.SelectSingleNode("//td[@nowrap='nowrap']//span[@class='gen']")
If Not divnodes Is Nothing Then
MsgBox(div.InnerText)
End If我也试过了
Msgbox(div.Attributes("style").Value)但是没有工作。
你能跟我说一下吗。谢谢~
发布于 2017-08-16 16:26:50
我通过添加"/span“解决了这个问题
Dim divnodes As HtmlNodeCollection =doc.DocumentNode.SelectNodes("//td[@nowrap='nowrap']//span[@class='gen']/span")
If divnodes IsNot Nothing Then
For each div as HtmlNode in divnodes2
MsgBox(div.InnerText)
Next
End Ifhttps://stackoverflow.com/questions/45708403
复制相似问题