NDHpple

master

NDHpple is a Swift wrapper on the XMLPathQuery library.
ndavon/NDHpple

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

Build the package with the most recent Swift 2.2 Snapshot (as of January 28th) with this command:

swift build -Xcc -I/usr/include/libxml2 -c release

This will build NDHpple as module. You can also pass this URL (http://github.com/ndavon/NDHpple) as dependency in another package but you'll still have to pass the include path as compiler flag.

USAGE

See Example/main.swift for a more detailed sample.

import NDHpple

let html = try! String(contentsOf: URL(string: url)!) 

let parser = NDHpple(HTMLData: html)
let result = parser.search(withQuery: query)

result.flatMap { $0.text }.forEach { 
        print($0)
}

Please note that some slight modifications were made that will probably break your existing implementation.

Description

  • Swift Tools 3.1.0
View More Packages from this Author

Dependencies

Last updated: Thu Dec 05 2024 09:39:54 GMT-1000 (Hawaii-Aleutian Standard Time)