Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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>
- <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>
- var regex = new Regex(@"<span id=""point_total"" class=""tooltip"" oldtitle="".*?"" aria-describedby=""ui-tooltip-0"">(.*?)</span>");
- var match = regex.Match(@"<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>");
- var result = match.Groups[1].Value;
- HtmlDocument doc = new HtmlDocument;
- doc.Load("filepath");
- HtmlNode node = doc.DocumentNode.SelectSingleNode("//span"); //Here, you can also do something like (".//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.']"); to select specific spans, etc...
- string value = node.InnerText; //this string will contain the value of span, i.e. <span>***value***</span>
- // <TAG(.*?)>(.*?)</TAG>
- // Example
- var regex = new System.Text.RegularExpressions.Regex("<h1(.*?)>(.*?)</h1>");
- var m = regex.Match("Hello <h1 style='color: red;'>World</h1> !!");
- Console.Write(m.Groups[2].Value); // will print -> World
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement