프로젝트
GitHub에서 보기
topfunky/hpple
소개
Hpricot에서 영감을 받은 Objective-C용 XML/HTML 파서입니다.
웹 및 앱 개발What you can do
- Easy searching by XPath (CSS selectors are planned)
- Parses HTML (XML coming soon)
- Easy access to tag content, name, and attributes.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -2
- in 1 month
- 0
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
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
관련 프로젝트 살펴보기
불러오는 중…
