title: C# +HTMLAgilityPack: retrive background-url value
body: <p>I'm going to extract background of some HTML files and replace them with new values. <br/>
  In order to control if <strong>BODY</strong> tag got background defined in its style as css i used below code:</p>
  
  <pre><code>foreach (HtmlNode bodyNode in doc.DocumentNode.SelectNodes("//body"))
  {
    if (bodyNode.Attributes.Contains("style") &amp;&amp; bodyNode.Attributes["style"].Value.Replace(" ","").Contains("background-image:url"))
    {
      //code to replace background-url
    }
  
  }
  </code></pre>
  
  <p>my problem is how to retrive background-url value from such tag from style properties:</p>
  
  <pre><code>&lt;body style="background-image: url('test/bg.jpg')" &gt;
  </code></pre>
  
  <p>and replace it with new value like below:</p>
  
  <pre><code>&lt;body style="background-image: url('new value')" &gt;
  </code></pre>