基于 Swift 的 XMLPathQuery 库 NDHpple

码农软件 · 软件分类 · 其他开发相关 · 2019-10-22 10:58:34

软件介绍

NDHpple 是 XMLPathQuery 库的 Swift 封装器。

安装

  • 拖拽 NDHpple 文件到项目中

  • 添加以下代码到项目的 Bridging Header:

#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/HTMLparser.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>

用法

查看 AppDelegate.swift 来获取更多的细节示例:

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

for node in result {
                
    println(node)
}


本文地址:https://codercto.com/soft/d/17304.html

Python for Everyone

Python for Everyone

Cay S. Horstmann、Rance D. Necaise / John Wiley & Sons / 2013-4-26 / GBP 181.99

Cay Horstmann's" Python for Everyone "provides readers with step-by-step guidance, a feature that is immensely helpful for building confidence and providing an outline for the task at hand. "Problem S......一起来看看 《Python for Everyone》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试