title: How do I extract specific HTML's part of text using HtmlAgilityPack?
body: <p>When viewing the page source for a page I use CTRL-F to find all occurrences of "id=", which gives me 82 results. What I want to do is to extract only the numbers after the "id=". For example, if the attribute is <code>id=344</code> then I only want to get the 344 as string and add it to the List.</p>
  
  <p>The way I'm doing it now I'm not getting links I thought I will get all the links this way and make filter after it but I'm getting empty string and some texts nothing from what I wanted. I guess doing InnerText is wrong.</p>
  
  <p><a href="http://view-source:http://www.tapuz.co.il/forums2008/" rel="nofollow">Source View</a></p>
  
  <pre><code>idsnumbers = new List&lt;string&gt;();
  HtmlWeb hw = new HtmlWeb();
  HtmlAgilityPack.HtmlDocument doc = hw.Load("http://www.tapuz.co.il/forums2008/");
  foreach (HtmlNode link in doc.DocumentNode.SelectNodes("//a[@href]"))
  {
      idsnumbers.Add(link.InnerText);
  }
  </code></pre>
  
  <p>Update getting null exception:</p>
  
  <pre><code>System.NullReferenceException was unhandled
    _HResult=-2147467261
    _message=Object reference not set to an instance of an object.
    HResult=-2147467261
    IsTransient=false
    Message=Object reference not set to an instance of an object.
    Source=WindowsFormsApplication1
    StackTrace:
         at WindowsFormsApplication1.Form1..ctor() in d:\C-Sharp\Tapuz Images\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 50
         at WindowsFormsApplication1.Program.Main() in d:\C-Sharp\Tapuz Images\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:line 19
         at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
         at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
         at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
         at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
         at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
         at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
         at System.Threading.ThreadHelper.ThreadStart()
    InnerException: 
  </code></pre>