title: HTML Agility Pack - Filter Href Value Results
body: <p>I'm working on a web scraper. The following text shows the results of the code given at the end of this question, which gets the values of all hrefs from a page. </p>
  
  <p>I only want to get values that contain <code>docid=</code></p>
  
  <blockquote>
    <p>index.php?pageid=a45475a11ec72b843d74959b60fd7bd64556e8988583f</p>
    
    <p>#</p>
    
    <p>summary_of_documents.php</p>
    
    <p>index.php?pageid=a45475a11ec72b843d74959b60fd7bd64579b861c1d7b</p>
    
    <p>#</p>
    
    <p>index.php?pageid=a45475a11ec72b843d74959b60fd7bd64579e0509c7f0&amp;apform=judiciary</p>
    
    <p>decisions.php?doctype=Decisions / Signed
    Resolutions&amp;docid=1263778435388003271#sam</p>
    
    <p>decisions.php?doctype=Decisions / Signed
    Resolutions&amp;docid=12637789021669321156#sam</p>
    
    <p>?doctype=Decisions / Signed Resolutions&amp;year=1986&amp;month=January#head</p>
    
    <p>?doctype=Decisions / Signed Resolutions&amp;year=1986&amp;month=February#head</p>
  </blockquote>
  
  <p>Here's the code:</p>
  
  <pre><code>        string url = urlTextBox.Text;
          string sourceCode = Extractor.getSourceCode(url);
  
          HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
          doc.LoadHtml(sourceCode);
          List&lt;string&gt; links = new List&lt;string&gt;();
  
          if (links != null)
          {
              foreach (HtmlAgilityPack.HtmlNode nd in doc.DocumentNode.SelectNodes("//a[@href]"))
              {
                  links.Add(nd.Attributes["href"].Value);
              }
          }
          else
          {
              MessageBox.Show("No Links Found");
          }
  
          if (links != null)
          {
              foreach (string str in links)
              {
                  richTextBox9.Text += str + "\n";
              }
          }
          else
          {
              MessageBox.Show("No Link Values Found");
          }
  </code></pre>
  
  <p>How can I do this?</p>