title: How get <body> element from the html which one have as a string
body: <p>I have a stupid problem. An <code>jQuery.ajax</code> request return me a <strong>full HTML text</strong> as a string. I receive such response in an case of error on the server. The server give me an error description which I want to place inside of the corresponding place of my current page.</p>
  
  <p>So now the question: I have a string contains full HTML document (which is not an XML!!! see <code>&lt;hr&gt;</code> element inside). I need to have for example only BODY part as a jQuery object. Then I could append it to the corresponding part of my page.</p>
  
  <p>Here is an example of the string which I need to parse:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;The resource cannot be found.&lt;/title&gt;
      &lt;style&gt;
        body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
        p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
        // ...
      &lt;/style&gt;
    &lt;/head&gt;
  
    &lt;body bgcolor="white"&gt;
      &lt;span&gt;&lt;H1&gt;Server Error in '/' Application.&lt;hr width=100% size=1 color=silver&gt;&lt;/H1&gt;
            &lt;h2&gt; &lt;i&gt;The resource cannot be found.&lt;/i&gt; &lt;/h2&gt;&lt;/span&gt;
      &lt;font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "&gt;
  
        &lt;b&gt; Description: &lt;/b&gt;HTTP 404. The resource you are looking for ...bla bla....
        &lt;br&gt;&lt;br&gt;
  
        &lt;b&gt; Requested URL: &lt;/b&gt;/ImportBPImagesInfos/Repository.svc/GetFullProfilimageSw&lt;br&gt;&lt;br&gt;
  
        &lt;hr width=100% size=1 color=silver&gt;
  
        &lt;b&gt;Version Information:&lt;/b&gt;&amp;nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
  
      &lt;/font&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  &lt;!--
  [HttpException]: A public action method &amp;#39;....
     at System.Web.Mvc.Controller.HandleUnknownAction(String actionName)
     at System.Web.Mvc.Controller.ExecuteCore()
     at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
     at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext)
     at System.Web.Mvc.MvcHandler.&lt;&gt;c__DisplayClass8.&lt;BeginProcessRequest&gt;b__4()
     at System.Web.Mvc.Async.AsyncResultWrapper.&lt;&gt;c__DisplayClass1.&lt;MakeVoidDelegate&gt;b__0()
     at System.Web.Mvc.Async.AsyncResultWrapper.&lt;&gt;c__DisplayClass8`1.&lt;BeginSynchronous&gt;b__7(IAsyncResult _)
     at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
     at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
     at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag)
     at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
     at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)
  --&gt;
  </code></pre>