0
如何獲取此HTML塊中的文本?在br/tag之前和之後獲取文本 - vb.net中的htmlagilitypack
<td align="left" style="">2000000033754<br/>CHOICE_HARVEST-GALA _APPLE-10S</td>
我使用HTMLAgilityPack,這是我的代碼在vb.net
If cols1(m).OuterHtml.Contains("<br>") Then
' split into barcode and item name
Dim barcode As HtmlNode = cols1(m).SelectSingleNode("text()[preceding::br]")
sSQL = sSQL & "," & ToCHR(barcode.InnerText.Trim)
Dim item As HtmlNode = cols1(m).SelectSingleNode("text()[following::br]")
sSQL = sSQL & "," & ToCHR(item.InnerText.Trim)
我需要得到這些結果
barcode.innertext = "2000000033754"
- 這是工作
item.innertext = "CHOICE_HARVEST-GALA _APPLE-10S"
- 需要幫助有了這個
嘗試分開嗎? – 2014-10-08 03:36:51