public string GetProductUrl(string EAN) { string url = "http://www.brennenstuhl.com/index.php?module=products&lang=en&index[products][action]=livesearch&index[products][pattern]=" + EAN; try { string unprocessedHtml = HtmlHandler.GetPageByLink(url); HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(unprocessedHtml); var result = doc.DocumentNode.SelectNodes("//a[@href]").First(); var href = result.Attributes["href"].Value; return("https://www.brennenstuhl.com/" + href); } catch (Exception e) { Console.WriteLine("No product found!"); return(null); } }