Parsing website info with a database and web service I have to make project for school in C# which has to use database and web service. I have made a program which starts a web service and gets a function from there which is used for connecting to a website. I am using HTML Agility Pack for parsing info from that website. Website info is then written in textbox and stored in database.

Here is one function from project, and the rest is here.

    public void HtmlParser()
    {
        Encoding enc = Encoding.UTF8;

        HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();

        htmlDoc.Load(client.Request(), enc);

        HtmlNode root = htmlDoc.DocumentNode;
        HtmlNodeCollection jobNode = root.SelectNodes("//div[@class='jobBox']");
        HtmlNodeCollection headerNode = root.SelectNodes("//div[@class='jobBox']/h1");
        HtmlNodeCollection contentNode = root.SelectNodes("//div[@class='jobBox']/div[@class='content']");
        HtmlNodeCollection linkNode = root.SelectNodes("//div[@class='jobBox']/a");

        jobs = new List&lt;string&gt;();
        headers = new List&lt;string&gt;();
        content = new List&lt;string&gt;();
        links = new List&lt;string&gt;();
        full_links = new List&lt;Uri&gt;();

        foreach (HtmlNode node in jobNode)
        {
            jobs.Add(node.InnerText);
        }
        foreach (HtmlNode node in headerNode)
        {
            headers.Add(node.InnerText.Trim());
        }
        foreach (HtmlNode node in contentNode)
        {
            content.Add(node.InnerText.Trim());
        }

        foreach (HtmlNode node in linkNode)
        {
            links.Add(node.GetAttributeValue("href", null).Trim());
            Uri temp = new Uri(link + node.GetAttributeValue("href", null).Trim());
            full_links.Add(temp);
        }

        htmlDoc.Save("file.htm", enc);

        StringParser();
    }


Some variables are in Croatian, so don't get confused. I am looking for helpful reviews and tips on how I can make my code better.
One comment I'd have is that there is a LOT going on in that method... but for the most part 
each section is the same... 


GetNodeCollection
Loop Through it
Add it to a list


You could probably pull that out into a method to shorten your code.

public List&lt;string&gt; ParseSection(HtmlNode root, string nodePath, bool isLink = false)
{
    HtmlNodeCollection nodes = root.SelectNodes(nodePath);
    List&lt;string&gt; parsedNodes = new List&lt;string&gt;();
    foreach (HtmlNode node in nodes)
    {
        if(isLink)
        {
            parsedNodes.Add(node.GetAttributeValue("href", null).Trim());
        }
        else
        {
            parsedNodes.Add(node.InnerText.Trim());
        }
    }
    return parsedNodes;
}

public void HtmlParser()
{
    Encoding enc = Encoding.UTF8;
    HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
    htmlDoc.Load(client.Request(), enc);
    HtmlNode root = htmlDoc.DocumentNode;
    HtmlNodeCollection linkNode = root.SelectNodes();

    List&lt;string&gt; jobs = ParseSection(root, "//div[@class='jobBox']");
    List&lt;string&gt; headers = ParseSection(root, "//div[@class='jobBox']/h1");
    List&lt;string&gt; content = ParseSection(root, "//div[@class='jobBox']/div[@class='content']");
    List&lt;string&gt; links = ParseSection(root, "//div[@class='jobBox']/a", true); //TRUE
    List&lt;Uri&gt; fullLinks = links.Select(l =&gt; new Uri(l));

    htmlDoc.Save("file.htm", enc);
    StringParser();
}