目前采集还可以, 但是,我还想采集 td 中的 title属性 怎么采集呢?
<tr align=right><td title="#199109 ZD_XD_SELL_01--5642595">5642601</td><td class=msdate nowrap>2017.08.09 01:02:20</td><td>sell</td><td class=mspt>1.50</td><td>usdjpy</td><td style="mso-number-format:0\.000;">110.250</td><td style="mso-number-format:0\.000;">0.000</td><td style="mso-number-format:0\.000;">0.000</td><td class=msdate nowrap>2017.08.09 01:05:57</td><td style="mso-number-format:0\.000;">110.237</td><td class=mspt>0</td><td class=mspt>0</td><td class=mspt>0</td><td class=mspt>1 950</td></tr>
Dim data As String = FileSys.ReadAllText("C:\Users\Administrator\Desktop\DetailedStatement.htm").Replace(vbcrlf, "").Replace(chr(9), "")
Dim reg As new System.Text.RegularExpressions.Regex("(?><tr.*?>).*?</tr>")
Dim reg2 As new System.Text.RegularExpressions.Regex("(?<=<td.*?>).*?(?=<)")
Dim mc As object = reg.Matches(data)
Dim dr As DataRow
For i As Integer = 3 To mc.count - 33
Dim m As object = reg2.Matches(mc(i).value)
Dim n As object = reg3.Matches(m(0).value)
If m(0).value <> " "
dr = DataTables("DetailedStatement").AddNew()
dr("Ticket") = m(0).value
dr("OpenTime") = m(2).value
dr("Type") = m(4).value
dr("Size") = m(6).value
dr("Item") = m(8).value
dr("Price") = m(10).value
dr("SL") = m(12).value
dr("TP") = m(14).value
dr("CloseTime") = m(16).value
dr("Price_c") = m(18).value
dr("Commission") = n(0).value
If m.count =28
dr("Taxes") = m(22).value
dr("Swap") = m(24).value
dr("Profit") = m(26).value
End If
End If
Next