public static List <Company> SearchURLForAllCompanies(string url) { HtmlWeb htmlWeb = new HtmlWeb(); HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(Scrolling.Scroll(url)); List <Company> allCompanies = null; HtmlNodeCollection nodes = doc.DocumentNode.SelectNodes("//div[@class='company-action company_inner_right']"); List <string> companyUrlList = new List <string>(); try { // find the address of a particular company foreach (HtmlNode node in nodes) { var jobUrl = node.SelectSingleNode(".//a").Attributes[0].Value; companyUrlList.Add(@"https://staff.am" + jobUrl); } allCompanies = GetAllCompaniesWithTheirInfo(companyUrlList); } catch (Exception) { } return(allCompanies); }