Quote:
Originally Posted by JavaWizKid
THANKS, this is perfect! I forgot about the word parse haha. I've came across "pple" which is a html/xml parser for iPhone. I've correctly installed it and created the following code:
Code:
NSData *data = [[NSData alloc] initWithContentsOfFile:@"http://www.javawizkid.com/"];
// Create parser
TFHpple *xpathParser = [[TFHpple alloc] initWithHTMLData:data];
NSArray *elements = [xpathParser search:@"//title"];
NSLog(@"%@",elements);
However, it kees spitting out the error, unable to parse. No idea why?
|
and exactly which is the error?
have you added all needed files?
have you imported? #import "TFHpple.h"
Code:
initWithContentsOfFile:@"http://www.javawizkid.com/"
ehm......you think that it is a file?
download the file with NSUrlConnection or AsiHttpRequest and then load it as file or use initWithContentsOfUrl:myUrl