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:
Here is the code:
public void Crawler(string url, int pid)
{
HtmlWeb hw = new HtmlWeb();
try
{
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']");