How VBS parses an HTML document

Source: Internet
Author: User

How VBS parses HTML documents (Htmlfile)

Submission: MDXY-DXY font: [Increase decrease] Type: Reprint time: 2014-06-18 I want to comment

About VBS collection, online popular more methods are regular, in fact, Htmlfile can parse HTML code, but if DesignMode not open, sometimes package security information

About VBS collection, online popular more methods are regular, in fact, Htmlfile can parse HTML code, but if DesignMode not open, sometimes package security information.
But to open the DesignMode (@ the evening of the Prophet), all JS will not be executed, just clean DOM documents, so in the case of forced to open DesignMode general situation remains the default.

?
1234567891011121314 Set html = CreateObject("htmlfile")Set http = CreateObject("Msxml2.ServerXMLHTTP")html.designMode = "on" ‘ 开启编辑模式http.open "GET", "http://www.cnblogs.com/", Falsehttp.sendstrHtml = http.responseTexthtml.write strHtml ‘ 写入数据Set post_list = html.getElementById("post_list")For Each el In post_list.children  WScript.Echo el.getElementsByTagName("a")(0).innerTextNext

In fact, the method is very simple, but the focus will be VBS, but not necessarily DOM operation, so this is very tangled.
I have no choice but to rely on your own, I just share the idea,

Parsing HTML is easier and quicker than regular.

How VBS parses an HTML document

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.