Getting the HTML source through the WebBrowser control in C#
<p>I tried to get HTML Source in the following way:</p>

<pre><code>webBrowser1.Document.Body.OuterHtml;
</code></pre>

<p>but it does not work. For example, if the original HTML source is :</p>

<pre><code>&lt;html&gt;
&lt;body&gt;
    &lt;div&gt;
        &lt;ul&gt;
            &lt;li&gt;
                &lt;h3&gt;
                    Manufacturer&lt;/h3&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;a href="/4566-6501_7-0.html?

filter=1000036_3808675_100021_10194772_"&gt;Sony &lt;/a&gt;(44)&lt;/li&gt;
            &lt;li&gt;&lt;a href="/4566-6501_7-0.html?

filter=1000036_108496_100021_10194772_"&gt;Nikon &lt;/a&gt;(19)&lt;/li&gt;
            &lt;li&gt;&lt;a href="/4566-6501_7-0.html?

filter=1000036_3808726_100021_10194772_"&gt;Panasonic &lt;/a&gt;(37)&lt;/li&gt;
            &lt;li&gt;&lt;a href="/4566-6501_7-0.html?

filter=1000036_3808769_100021_10194772_"&gt;Canon &lt;/a&gt;(29)&lt;/li&gt;
            &lt;li&gt;&lt;a href="/4566-6501_7-0.html?

filter=1000036_2913388_100021_10194772_"&gt;Olympus &lt;/a&gt;(21)&lt;/li&gt;
            &lt;li class="seeAll"&gt;&lt;a href="/4566-6501_7-0.html?

sa=1000036&amp;filter=100021_10194772_" class="readMore"&gt;See all manufacturers &lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>but the output of <code>webBrowser1.Document.Body.OuterHtml</code> is:</p>

<pre><code>&lt;body&gt;
    &lt;div&gt;
        &lt;ul&gt;
            &lt;li&gt;
                &lt;h3&gt;
                    Manufacturer&lt;/h3&gt;
                &lt;li&gt;&lt;a href="/4566-6501_7-0.html?filter=1000036_3808675_100021_10194772_"&gt;Sony &lt;/a&gt;(44)
                    &lt;li&gt;&lt;a href="/4566-6501_7-0.html?filter=1000036_108496_100021_10194772_"&gt;Nikon &lt;/a&gt;(19)
                        &lt;li&gt;&lt;a href="/4566-6501_7-0.html?filter=1000036_3808726_100021_10194772_"&gt;Panasonic
                        &lt;/a&gt;(37)
                            &lt;li&gt;&lt;a href="/4566-6501_7-0.html?filter=1000036_3808769_100021_10194772_"&gt;Canon &lt;/a&gt;
                                (29)
                                &lt;li&gt;&lt;a href="/4566-6501_7-0.html?filter=1000036_2913388_100021_10194772_"&gt;Olympus &lt;/a&gt;
                                    (21)
                                    &lt;li class="seeAll"&gt;&lt;a class="readMore" href="/4566-6501_7-0.html?sa=1000036&amp;amp;filter=100021_10194772_"&gt;
                                        See all manufacturers &lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p>as you can see, many <code>&lt;/li&gt;</code> are lost.</p>

<p>is there a way to get HTML source in <code>WebBrower</code> control correctly? Note that in my application, I try to use <code>WebBrowser</code> to add coordinate info to every node and output its HTML source with coordinate info which is added as attributes of nodes.</p>

<p>anybody can do me a favor?</p>
