HTMLAgility in UWP App => List all url of an website

Topics: Developer Forum, User Forum
Mar 27 at 10:28 AM
Edited Mar 27 at 11:20 AM
Hello,
I want to List URL of an Website. It works via Regex and Agility pack - on Windows form Apps.

Now I want to perform this Task in a UWP app. Unfortunately there is no System.web.UI;

So I tied this Code from :
(AgilityUWP)
and Combine it with:
http://www.codeproject.com/Articles/659019/Scraping-HTML-DOM-elements-using-HtmlAgilityPack-H


So I made the following Code. But this one only get me the URL of the page I am on. But I am looking for all URLs in the Body of the HTML Page:
    private void button_Click(object sender, RoutedEventArgs e)
    {


        HtmlDocument htmlDoc = new HtmlDocument();
        htmlDoc.LoadHtml(InputTextBox.Text);

        HtmlNode docNodes = htmlDoc.DocumentNode;
        var aTags = htmlDoc.DocumentNode.Descendants();

        int counter = 1;
        if (aTags != null)
        {
            foreach(var aTag in aTags)
            {
                UrlList.Items.Add(counter + ". " + aTag.InnerHtml);
                counter++;
            }

        }

    }