For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > March 2008 > Manipulate HTML string as DOM









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Manipulate HTML string as DOM
Mike Gleason jr Couturier

2008-03-28, 7:28 pm

(.NET 2.0, C#, VS 2005)

Hi,

I have a string representing a web page file.

I want to convert the string into an object to navigate through it's
elements.

I tried XmlDocument but I get a parsing error on the string...

Thanks


bruce barker

2008-03-28, 7:28 pm

you need an HtmlParser. .net does not supply one other than hosting IE (not
recommended for an asp.net site).

google HtmlParser for the toolkit of your choice. (most are in java though)


-- bruce (sqlwork.com)


"Mike Gleason jr Couturier" wrote:

> (.NET 2.0, C#, VS 2005)
>
> Hi,
>
> I have a string representing a web page file.
>
> I want to convert the string into an object to navigate through it's
> elements.
>
> I tried XmlDocument but I get a parsing error on the string...
>
> Thanks
>
>
>

Peter Bromberg [C# MVP]

2008-03-28, 7:28 pm

Look into Simon Mourier's HtmlAgilityPack. It provides an XML-DOM like
HtmlDocument class that does what Bruce said. Find it on codeplex.com
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net


"Mike Gleason jr Couturier" wrote:

> (.NET 2.0, C#, VS 2005)
>
> Hi,
>
> I have a string representing a web page file.
>
> I want to convert the string into an object to navigate through it's
> elements.
>
> I tried XmlDocument but I get a parsing error on the string...
>
> Thanks
>
>
>

Mike Gleason jr Couturier

2008-03-28, 7:28 pm

"Mike Gleason jr Couturier" <nospam@invalidhost.com> a écrit dans le message
de news: %239smT9OkIHA.3612@TK2MSFTNGP03.phx.gbl...
> (.NET 2.0, C#, VS 2005)
>
> Hi,
>
> I have a string representing a web page file.
>
> I want to convert the string into an object to navigate through it's
> elements.
>
> I tried XmlDocument but I get a parsing error on the string...
>
> Thanks
>


Thanks a lot guys!

Mike


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com