title: html agility pack Object reference not set to an instance of an object
body: <p>I for parsing html use Html Agility Pack and so Grate stuff 
  but i encountered some bad things :|
  this is my Background Code </p>
  
  <pre><code>public static HtmlDocument GetXHtmlFromUri2(string uri)
      {
          HttpClient client = HttpClientFactory.Create(new CustomeHeaderHandler());
  
  
          var htmlDoc = new HtmlDocument()
                                     {
                                         OptionCheckSyntax = true,
                                         OptionFixNestedTags = true,
                                         OptionAutoCloseOnEnd = true,
                                         OptionReadEncoding = true,
                                         OptionDefaultStreamEncoding = Encoding.UTF8,
                                     };
  
          htmlDoc.LoadHtml(client.GetStringAsync(uri).Result);
  
          return htmlDoc;
  
      }
  </code></pre>
  
  <p>i use html agility for WebApi (Mvc4) and this is Get Method Logic</p>
  
  <pre><code>//GET api/values
      public string GetHtmlFlights()
      {
  
          var result = ClientFlightTabale.GetXHtmlFromUri2("http://ikiafids.ir/departureFA.html");
          HtmlNode node = result.DocumentNode.SelectSingleNode("//table[1]/tbody/tr[1]");
  
          string temp = node.FirstChild.InnerHtml.Trim();
  
          return temp;
  
      }
  </code></pre>
  
  <p>but when i Call this method (from Browser and Fiddler) encountered Exceptions , With this theme :</p>
  
  <p>Object reference not set to an instance of an object, and this exception Is concerned this line</p>
  
  <pre><code>string temp = node.FirstChild.InnerHtml.Trim();
  </code></pre>
  
  <p>can anyone help me please ?</p>