locked
Constructing HtmlDocument from stream RRS feed

  • Question

  • I'm reading an Html page as a stream and I already got a Stream object with it but how do I convert it to queryable HTML document object so I can get header and content from it? HtmlDocument doesn't seem to have constructor or Load method and all of the examples I found so far deal with host browser's page instead of arbitrary Html page.

    Monday, October 6, 2008 12:50 AM

Answers

  • hi,

    I'm reading an Html page as a stream and I already got a Stream object with it but how do I convert it to queryable HTML document object so I can get header and content from it?

    Based on your description, you has read the Html page as a stream, so you can try to store the html document into a string variable, and then use regular expressions to get the get header and content from the string.

    About the regular expressions, you can try to refer:  http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(VS.80).aspx

    Wednesday, October 8, 2008 4:02 AM

All replies

  • Does lack of replies here mean Html is not supposed to be parsed/constucted by Silverlight? :)

    Monday, October 6, 2008 8:23 PM
  • hi,

    I'm reading an Html page as a stream and I already got a Stream object with it but how do I convert it to queryable HTML document object so I can get header and content from it?

    Based on your description, you has read the Html page as a stream, so you can try to store the html document into a string variable, and then use regular expressions to get the get header and content from the string.

    About the regular expressions, you can try to refer:  http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(VS.80).aspx

    Wednesday, October 8, 2008 4:02 AM