VB.NET HtmlDocument Source

PhilippeRenaud
PhilippeRenaud used Ask the Experts™
on
Hello EE,

When I go over a specific web site and look at the source in Chrome Versus Internet Explorer, Its a bit different. (probably the developers renders differently by browsers.) For example, one or two div with class are visible inside the source of IE but not under Chrome.


My question, inside VISUAL STUDIO, in vb.net, if I open via htmlDocument with HTMLAgilityPack and I see the source, its the same as my Chrome source.

How Can I make happen to see the source as like I saw in my IE source ?

I saw in internet to use mshtml and IhtmlDocument but if I understand well this is obsolete...
I dont really want to use WebBrowser object also.... any idea ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Developer
Commented:
Probably you need to specify some specific "useragent" to get the html code.
If the site renders different from different browsers, you need to choose the right user agent to get the source code in the same way as in IE. Check your IE version and user-agent string.

For example, see: http://www.useragentstring.com/ from IE and try to get it also from VB to check what user agent is used.

Author

Commented:
ok and while i search once i know.. how do i change a useragent in vb?

Author

Commented:
Looks like it will change only the userAgent for WebBrowser control no ?

I dont understand if its possible to change only for the HtmlDocument variable (i dont have any web browser control in my app)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial