VB.NET HtmlDocument Source

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 ?
LVL 1
PhilippeRenaudAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

F IgorDeveloperCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PhilippeRenaudAuthor Commented:
ok and while i search once i know.. how do i change a useragent in vb?
PhilippeRenaudAuthor 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)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.