Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8403005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:13:44+00:00 2026-06-09T22:13:44+00:00

Any good tutorial on parsing online HTML pages using msxml/IXMLDOMDocument? I need to parse

  • 0

Any good tutorial on parsing online HTML pages using msxml/IXMLDOMDocument?

I need to parse HTML pages using XPATH expressions.

Most probably some of HTML pages will not be 100% valid , so I need to configure parser to be more “friendly” or not so strict for such pages.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:13:46+00:00Added an answer on June 9, 2026 at 10:13 pm

    You can tidy up invalid html using tidy or a tidy wrapper library. After doing this you can parse the html with specifying xhtml namespace using MSXML.
    EfTidy is a good, up to date open source tidy wrapper project to tidying up html.
    I want to show an example written in VBScript to addressing with XPath to get title of this question.

    'EfTidy constants
    Const XhtmlOut = 1
    Const DoctypeLoose = 3 'for transitional
    
    Dim EfTidy, sInvalidHTML, sValidHTML
    
    With CreateObject("MSXML2.XMLHTTP.6.0")
        .open "GET", "http://stackoverflow.com/q/12027205/"
        .send
        sInvalidHTML = .responseText
    End With
    
    Set EfTidy = CreateObject("EfTidy.tidyCom")
    With EfTidy.Option 'config
        .Clean = True
        .OutputType = XhtmlOut
        .DoctypeMode = DoctypeLoose
    End With
    sValidHTML = EfTidy.TidyMemToMem(sInvalidHTML)
    
    With CreateObject("MSXML2.DomDocument.6.0")
        .async = False
        .validateOnParse = False
        .resolveExternals = True
        .setProperty "ProhibitDTD", False
        If .LoadXml(sValidHTML) Then
            .setProperty "SelectionLanguage", "XPath"
            .setProperty "SelectionNamespaces", "xmlns:xhtml='http://www.w3.org/1999/xhtml'"
            WScript.Echo .SelectSingleNode("//xhtml:div[@id='question-header']/xhtml:h1").Text
        End If
    End With
    

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any good tutorial and example for restful web services using jquery &
I asked this question previously ( any-good-tutorial-for-moving-from-eclipse-to-vim ) From the inputs, I started using
Does anyone know any good tutorial about using NAnt for native code build process
Is there any good tutorial or code snippet out there on how to use
Is there any good tutorial for creating WPF controls entirely at runtime? Thanks
Can any one suggest a good tutorial for Mozilla rhino. What i want to
Does anyone know any good tutorial on how to upload a file with php
i search lot in the internet and could not find any good tutorial about
I want to learn about debian source packaging.Is there any good tutorial for that.Please
Is there any good tutorial available to learn how to use the android layout

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.