Getting the HTML source through the WebBrowser control in C# -


i tried html source in following way:

webbrowser1.document.body.outerhtml; 

but not work. example, if original html source :

<html> <body>     <div>         <ul>             <li>                 <h3>                     manufacturer</h3>             </li>             <li><a href="/4566-6501_7-0.html?  filter=1000036_3808675_100021_10194772_">sony </a>(44)</li>             <li><a href="/4566-6501_7-0.html?  filter=1000036_108496_100021_10194772_">nikon </a>(19)</li>             <li><a href="/4566-6501_7-0.html?  filter=1000036_3808726_100021_10194772_">panasonic </a>(37)</li>             <li><a href="/4566-6501_7-0.html?  filter=1000036_3808769_100021_10194772_">canon </a>(29)</li>             <li><a href="/4566-6501_7-0.html?  filter=1000036_2913388_100021_10194772_">olympus </a>(21)</li>             <li class="seeall"><a href="/4566-6501_7-0.html?  sa=1000036&filter=100021_10194772_" class="readmore">see manufacturers </a></li>         </ul>     </div> </body> </html> 

but output of webbrowser1.document.body.outerhtml is:

<body>     <div>         <ul>             <li>                 <h3>                     manufacturer</h3>                 <li><a href="/4566-6501_7-0.html?filter=1000036_3808675_100021_10194772_">sony </a>(44)                     <li><a href="/4566-6501_7-0.html?filter=1000036_108496_100021_10194772_">nikon </a>(19)                         <li><a href="/4566-6501_7-0.html?filter=1000036_3808726_100021_10194772_">panasonic                         </a>(37)                             <li><a href="/4566-6501_7-0.html?filter=1000036_3808769_100021_10194772_">canon </a>                                 (29)                                 <li><a href="/4566-6501_7-0.html?filter=1000036_2913388_100021_10194772_">olympus </a>                                     (21)                                     <li class="seeall"><a class="readmore" href="/4566-6501_7-0.html?sa=1000036&amp;filter=100021_10194772_">                                         see manufacturers </a></li>         </ul>     </div> </body> 

as can see, many </li> lost.

is there way html source in webbrower control correctly? note in application, try use webbrowser add coordinate info every node , output html source coordinate info added attributes of nodes.

anybody can me favor?

try using documenttext or documentstream properties.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -