Projetos
Ver no GitHub
topfunky/hpple
Sobre
Um parser de XML/HTML para Objective-C, inspirado no Hpricot.
Desenvolvimento web e de aplicativosO que você pode fazer
- Easy searching by XPath (CSS selectors are planned)
- Parses HTML (XML coming soon)
- Easy access to tag content, name, and attributes.
Crescimento medido de estrelas
- em 24 h
- 0
- em 7 dias
- 0
- em 15 dias
- -2
- em 1 mês
- 0
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
OriginalDESCRIPTION
Hpple: A nice Objective-C wrapper on the XPathQuery library for parsing HTML.
Inspired by why the lucky stiff's Hpricot.
CREDITS
Hpple was created by Geoffrey Grosenbach, Topfunky Corporation and PeepCode Screencasts.
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
More documentation and short screencast coming soon...
USAGE
See TFHppleHTMLTest.m in the Hpple project for samples.
#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 text]; // The text inside the HTML element (the content of the first text node)
[e tagName]; // "a"
[e attributes]; // NSDictionary of href, class, id, etc.
[e objectForKey:@"href"]; // Easy access to single attribute
[e firstChildWithTagName:@"b"]; // The first "b" child node
TODO
- Internal error catching and messages
- CSS3 selectors in addition to XPath
Explore projetos relacionados
Carregando…
