Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÈçºÎʹÓÃObjective C½âÎöHTMLºÍXML

ʹÓÃObjective-C½âÎöHTML»òÕßXML£¬ÏµÍ³×Ô´øÓÐÁ½ÖÖ·½Ê½Ò»¸öÊÇͨ¹ýlibxml£¬Ò»¸öÊÇͨ¹ýNSXMLParser¡£²»¹ýÕâÁ½ÖÖ·½Ê½¶¼ÐèÒª×Ô¼ºÐ´ºÜ¶à±àÂëÀ´´¦ÀíץȡÏÂÀ´µÄÄÚÈÝ£¬¶øÇÒ²»ÊǺÜÖ±¹Û¡£
ÓÐÒ»¸ö±È½ÏºÃµÄÀà¿âhpple£¬ËüÊÇÒ»¸öÇáÁ¿¼¶µÄ°ü×°¿ò¼Ü£¬¿ÉÒԺܺõĽâ¾öÕâ¸öÎÊÌâ¡£ËüÊÇÓÃXPathÀ´¶¨Î»ºÍ½âÎöHTML»òÕßXML¡£
°²×°²½Ö裺
-¼ÓÈë libxml2 µ½ÄãµÄÏîÄ¿ÖÐ
Menu Project->Edit Project Settings
ËÑË÷ “Header Search Paths”
Ìí¼ÓÐ嵀 search path “${SDKROOT}/usr/include/libxml2″
Enable recursive option
-¼ÓÈë libxml2 library µ½ÄãµÄÏîÄ¿
Menu Project->Edit Project Settings
ËÑË÷ “Other Linker Flags”
Ìí¼ÓÐ嵀 search flag “-lxml2″
-½«ÏÂÃæhppleµÄÔ´´úÂë¼ÓÈëµ½ÄãµÄÏîÄ¿ÖÐ:
HTFpple.h
HTFpple.m
HTFppleElement.h
HTFppleElement.m
XPathQuery.h
XPathQuery.m
-XPathѧϰµØÖ·http://www.w3schools.com/XPath/default.asp
ʾÀý´úÂ룺

#import "TFHpple.h"

NSData *data = [[NSData alloc] initWithContentsOfFile:@"example.html"];

// Create parser
xpathParser = [[TFHpple alloc] initWithHTMLData:data];

//Get all the cells of the 2nd row of the 3rd table
NSArray *elements = [xpathParser search:@"//table[3]/tr[2]/td"];

// Access the first cell
TFHppleElement *element = [elements objectAtIndex:0];

// Get the text within the cell tag
NSString *content = [element content];

[xpathParser release];
[data release];
 
ÁíÍ⣬»¹ÓÐÒ»¸öÀàËÆµÄ½â¾ö·½°¸¿ÉÒԲο¼
ElementParser http://github.com/Objective3/ElementParser


Ïà¹ØÎĵµ£º

ÓʼþÓªÏú±Ø¶ÁϵÁÐÎ壺´¿Îı¾ºÍHTMLÓʼþÀàÐÍ

´¿Îı¾»¹ÊÇHTML?
---ÄÄÒ»ÖÖÓʼþÀàÐ͸üÊʺÏÄ㣿
ÒýÑÔ
Èç¹ûÄãÕý×¼±¸Æô¶¯Ò»ÏîÓʼþÓªÏú¼Æ»®£¬µ«²»È·¶¨ÊǸÃÓÃͼÎIJ¢Ã¯µÄHTMLÓʼþÀ´ÌáÉýÓʼþµÄÊÓ¾õÌåÑ飬»¹ÊÇÓô¿Îı¾µÄÓʼþÀ´Ìá¸ßÓʼþµÄËÍ´ïÂÊ£¨²¢½ÚÊ¡×ÊÔ´£©£¬Comm100½«Í¨¹ý±¾ÎÄΪÄãÁоÙÕâÁ½ÖÖÓʼþÀàÐ͸÷×ÔµÄÓÅÁÓÊÆ£¬²¢½ÌÄãÈçºÎͨ¹ýÄ£°åÀàÐͺÍÏÔʾЧ¹ûÀ´ÓÅ»¯ÄãµÄÓʼþÓªÏú¼Æ»®¡ ......

±àд¿ÉÒÆÖ²C/C++³ÌÐòÒªµã

      1.·Ö²ãÉè¼Æ£¬¸ôÀëÆ½Ì¨Ïà¹ØµÄ´úÂë¡£¾ÍÏñ¿É²âÊÔÐÔÒ»Ñù£¬¿ÉÒÆÖ²ÐÔÒ²Òª´ÓÉè¼Æ×¥Æð¡£Ò»°ãÀ´Ëµ£¬×îÉϲãºÍ×îϲ㶼²»¾ßÓÐÁ¼ºÃµÄ¿ÉÒÆÖ²ÐÔ¡£×îÉϲãÊÇ
GUI£¬´ó¶àÊýGUI¶¼²»ÊÇ¿çÆ½Ì¨µÄ£¬ÈçWin32 SDKºÍMFC¡£×îϲãÊDzÙ×÷ϵͳAPI£¬´ó¶à²¿·Ö²Ù×÷ϵͳAPI¶¼ÊÇרÓõġ£
¡¡¡¡
Èç¹ûÕâÁ½²ãµÄ´úÂëÉ¢²¼ÔÚÕû¸öÈí¼ ......

ÓÃWebBrowserʵÏÖHTML½çÃæµÄÓ¦ÓÃ

HTMLµÄ½çÃæÓÐÒÔÏÂÌØµã£ºÍ¼ÎÄ»ìÅÅ£¬¸ñʽÁé»î£¬¿ÉÒÔ°üº¬Flash¡¢ÉùÒôºÍÊÓÆµµÈ£¬ÊµÏÖͼÎÄÉùÏñµÄ¶àýÌå½çÃæ£¬¶øÇÒÒ×ÓÚ½¨Á¢ºÍά»¤¡£ÁíÍ⣬HTMLµÄÏÔʾ»·¾³Ò»°ã»úÆ÷É϶¼¾ß±¸£¬Í¨³£²»ÐèÒª°²×°¶îÍâµÄÈí¼þ¡£µ±È»£¬HTML½çÃæÒ²ÓÐËüǷȱµÄ·½Ã棬¼´£º½çÃæ¿ØÖÆÄÜÁ¦ÓÐÏÞ£¬´úÂëµ÷ÊÔ²»±ã----ËäÈ»DHTMLÌṩÁ˱ȽÏÇ¿µÄ±à³ÌÌØÐÔ£¬µ«ÊÇ±ÈÆðDelphiµÄ ......

html select onchangeʼþ

<select name="CluefromType" id="CluefromType" style="width: 182px" onchange="return CluefromOtherTypeSelected();">
       <option value="Êг¡×ß·Ã">
        Êг¡×ß·Ã
       < ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ