Sha256: 5836d0feaedf06919e56618cf1da9563337a393764a2faf05f81da63533a0bf9
Contents?: true
Size: 1.45 KB
Versions: 2
Compression:
Stored size: 1.45 KB
Contents
# DESCRIPTION EXPERIMENTAL! Only a few hours old. Hpple: A nice Objective-C wrapper on the XPathQuery library for parsing HTML. Inspired by why the lucky stiff's [Hpricot](http://github.com/why/hpricot/tree/master). # AUTHOR Geoffrey Grosenbach, [Topfunky Corporation](http://topfunky.com) and [PeepCode Screencasts](http://peepcode.com). # FEATURES * Easy searching by XPath (CSS selectors are planned) * Parses HTML (XML coming soon) * Easy access to tag content, name, and attributes. # INSTALLATION * Open your XCode project and the Hpple project. * Drag the "Hpple" directory to your project. * Add the libxml2.2.dylib framework to your project and search paths as described at [Cocoa with Love](http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html) More documentation and short screencast coming soon... # USAGE See TFHppleHTMLTest.m in the Hpple project for samples. <pre> #import "TFHpple.h" NSData * data = [NSData dataWithContentsOfFile:@"index.html"]; TFHpple * doc = [[TFHpple alloc] initWithHTMLData:data]; NSArray * elements = [doc search:@"//a[@class='sponsor']"]; TFHppleElement * element = [elements objectAtIndex:0]; [e content]; // Tag's innerHTML [e tagName]; // "a" [e attributes]; // NSDictionary of href, class, id, etc. [e objectForKey:@"href"]; // Easy access to single attribute </pre> # TODO * Internal error catching and messages * CSS3 selectors in addition to XPath
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
motion-hpple-0.3.1 | vendor/Pods/hpple/README.markdown |
motion-hpple-0.3.0 | vendor/Pods/hpple/README.markdown |