Use the IHTMLDocument2 interface to get the data you want on the page instead of the regular expression

Source: Internet
Author: User
Source: Use IHTMLDocument2 interface to get the desired data on the page instead of regular expressions

The original Published time: 2010-07-01--from my Baidu article [imported by moving tools]

1. Use Ihtmldocument2::all to obtain all elements;
2. Use Ihtmlelementcollection::tags to obtain the element labeled span;
3. Use Ihtmlelement::classname to obtain an element of class named EX;
4. Use Ihtmlelement::innertext to obtain the text.

IHTMLDocument2 doc = new Htmldocumentclass ();
Doc.write (new object[] {ie. Outstring});
Doc.close ();
if (doc! = null)
{
IHTMLElementCollection IEC = (ihtmlelementcollection) doc.all.tags ("DD");

foreach (IHTMLElement II in IEC)
{
if (Ii.getattribute ("onmouseout", 0). ToString ()! = "")
{
Console.WriteLine (Ii.innertext);
string str = Ii.innertext;
}
}
}

Use the IHTMLDocument2 interface to get the data you want on the page instead of the regular expression

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.