HtmlAgilityPack Unable to connect to the remote server

Topics: User Forum
Oct 17, 2013 at 8:56 AM
Got a problem with Html Agility Pack When I run my code it says "Unable to connect to the remote server" Does anybody know why?

Here is the code:
public void Crawler(string url, int pid)

        HtmlWeb hw = new HtmlWeb();
            HtmlAgilityPack.HtmlDocument doc = hw.Load(url);
            HtmlNodeCollection nodes = doc.DocumentNode.SelectNodes("//a[@class='metatag-topi metatag-keywords']");
            HtmlNodeCollection nodes2 = doc.DocumentNode.SelectNodes("//div[@class='pagination']/a[@href]");
            HtmlNodeCollection phone = doc.DocumentNode.SelectNodes("//p[@class='phone fRight ml10']");