Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Neither. Load it into an (X/HT)MLDocument and use XPath, which is a standard method of manipulating XML and very powerful. The functions to look at are <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.selectnodes.aspx" rel="noreferrer">SelectNodes</a> and <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.selectsinglenode.aspx" rel="noreferrer">SelectSingleNode</a>. </p> <p>Since you are apparently using HTML (not XHTML), you should use <a href="http://www.codeplex.com/htmlagilitypack" rel="noreferrer">HTML Agility Pack</a>. Most of the methods and properties match the related XML classes.</p> <p>Sample implementation using XPath:</p> <pre><code> HtmlDocument doc = new HtmlDocument(); doc.Load(new StringReader(@"&lt;html&gt; &lt;head&gt;&lt;title&gt;Blah&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;br/&gt; &lt;div&gt;Here is your first text file: &lt;a href=""http://myServer.com/blah.txt""&gt;&lt;/div&gt; &lt;span&gt;Here is your second text file: &lt;a href=""http://myServer.com/blarg2.txt""&gt;&lt;/span&gt; &lt;div&gt;Here is your third text file: &lt;a href=""http://myServer.com/bat.txt""&gt;&lt;/div&gt; &lt;div&gt;Here is your fourth text file: &lt;a href=""http://myServer.com/somefile.txt""&gt;&lt;/div&gt; &lt;div&gt;Thanks for visiting!&lt;/div&gt; &lt;/body&gt; &lt;/html&gt;")); HtmlNode root = doc.DocumentNode; // 3 = ".txt".Length - 1. See http://stackoverflow.com/questions/402211/how-to-use-xpath-function-in-a-xpathexpression-instance-programatically HtmlNodeCollection links = root.SelectNodes("//a[@href['.txt' = substring(., string-length(.)- 3)]]"); IList&lt;string&gt; fileStrings; if(links != null) { fileStrings = new List&lt;string&gt;(links.Count); foreach(HtmlNode link in links) fileStrings.Add(link.GetAttributeValue("href", null)); } else fileStrings = new List&lt;string&gt;(0); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload