有没有办法添加 Kanna (https://github.com/tid-kijyun/Kanna https://github.com/tid-kijyun/Kanna) 到 XCode 中的 Playground?
我尝试过手动安装并通过 CocoaPods 安装它,但没有成功。我也尝试过将其打包到框架中,但仍然没有成功。
将不胜感激任何意见。
这些是我最常遇到的错误消息:
Github 上有一个有趣的库,允许在 Playground 中运行 pod。它还很年轻,但非常好。它创建一个新项目,并安装一个或多个 Pod,并准备在 Playground 中进行测试。
- 这可能是我们,但你在玩 https://github.com/neonichu/ThisCouldBeUsButYouPlaying
我用你的库进行了测试并且工作正常:
//: Please build the scheme 'KannaPlayground' first
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
import Kanna
let html = "<html><a>Hello World</a></html>"
if let doc = Kanna.HTML(html: html, encoding: NSUTF8StringEncoding) {
print(doc.title)
// Search for nodes by CSS
for link in doc.css("a, link") {
print(link.text)
print(link["href"])
}
// Search for nodes by XPath
for link in doc.xpath("//a | //link") {
print(link.text)
print(link["href"])
}
}
我希望这对你有帮助。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)