Skip to content

NDHpple is a Swift wrapper on the XMLPathQuery library.

License

Notifications You must be signed in to change notification settings

krupawan5618/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

Releases

No releases published

Packages

No packages published

Languages

  • Swift 84.6%
  • XML 13.6%
  • Objective-C 1.8%