我試圖讓提供的HTML(跨度)之間的數據(在這種情況下,31)2個html標籤之間獲取文本C#
這裏是原來的代碼(從檢查中鉻元素)
<span id="point_total" class="tooltip" oldtitle="Note: If the number is black, your points are actually a little bit negative. Don't worry, this just means you need to start subbing again." aria-describedby="ui-tooltip-0">31</span>
我有豐富的文本框,其中包含頁面的源代碼,這裏是相同的代碼,但在富文本框的第51行:
<DIV id=point_display>You have<BR><SPAN id=point_total class=tooltip jQuery16207621750175125325="23" oldtitle="Note: If the number is black, your points are actually a little bit negative. Don't worry, this just means you need to start subbing again.">17</SPAN><BR>Points </DIV><IMG style="FLOAT: right" title="Gain subscribers" border=0 alt="When people subscribe to you, you lose a point" src="http://static.subxcess.com/images/page/decoration/remove-1-point.png"> </DIV>
我該怎麼做呢?我嘗試了幾種方法,但他們都沒有爲我工作。
我正在嘗試從此頁檢索分值:http://www.subxcess.com/sub4sub.php 該數字會根據您的潛在客戶而變化。
如果您需要在代碼隱藏中訪問它,您可以向您的範圍添加「runat = server」並獲取內部文本。 – Tim
是一個jQuery解決方案好嗎? –
var yourdata = $('span')。html(); –