Skip to content

yamaya-masayuki/NDHpple

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DESCRIPTION

NDHpple is a Swift wrapper on the XMLPathQuery library based on Hpple.

CREDITS

NDHpple was created by Nicolai Davidsson, based on Hpple by Geoffrey Grosenbach, Topfunky Corporation.

INSTALLATION

  • Drag the NDHpple files to your project
  • add the following lines to your project's Bridging Header:
#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/HTMLparser.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>

USAGE

See AppDelegate.swift for a more detailed sample.

let html = NSString(data: data, encoding: NSUTF8StringEncoding)
let parser = NDHpple(HTMLData: html!)
let result = parser.searchWithXPathQuery(query)!

for node in result {
                
    println(node)
}

TODO

  • fix hacky code with further Swift versions
  • more error catching

About

NDHpple is a Swift wrapper on the XMLPathQuery library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 97.9%
  • Objective-C 2.1%