Results 1 to 4 of 4

Thread: Loading HTML into HTMLDocument without using Webbrowser control

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2000
    Location
    NJ, USA
    Posts
    326

    Loading HTML into HTMLDocument without using Webbrowser control

    Is it possible to load HTML content into the HTMLDocument object without having to use the WebBrowser control? I have an html file stored locally that I want to parse in order to find out which checkboxes are on and which are off.

    All of the examples I've found use the Webrowser. It just seems convoluted to have to use the WebBrowser in order to get to a DOM object.
    VB.NET 2005 Express with .Net 2.0
    C# 2010 .Net 4.0

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Loading HTML into HTMLDocument without using Webbrowser control

    I think you need the xmldocument instead of htmldocument. An html document is just one type of xml document.

    vb Code:
    1. Dim xmldoc As New Xml.XmlDocument
    2. xmldoc.Load("your filename here")
    3. 'do whatever you want to do with this document here
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  3. #3
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: Loading HTML into HTMLDocument without using Webbrowser control

    No, it's not possible. So you have 2 options:
    1. Use a WebBrower control (it doesn't have to be visible on your form).
    2. Treat the html as text (that's what it is) and parse it using regex or string manipulation.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  4. #4
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Re: Loading HTML into HTMLDocument without using Webbrowser control

    Ben


    Using Visual Basic 2005/2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width