SwiftSoup支持SWIFT4.0吗?我已经初始化了我的Podfile,并按照SwiftSoup GitHub repo https://github.com/scinfu/SwiftSoup的指示在运行pod安装之前添加了pod“GitHubhttps://github.com/scinfu/SwiftSoup”,但是我无法将它导入到Swift文件中。我使用XCode中的XCode文件作为SwiftSoup自述文件的指令,而不是.xcodeproj工作区。
Podfile看起来像:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'httpget' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for httpget
pod "SwiftSoup"
target 'httpgetTests' do
inherit! :search_paths
# Pods for testing
end
target 'httpgetUITests' do
inherit! :search_paths
# Pods for testing
end
end如果SwiftSoup不支持SWIFT4.0,有谁有我可以使用的替代方案吗?我试图解析一个包含HTML的Swift字符串对象,以删除所有脚本标记,并提取带有特定类的div标记。
本质上,我正在尝试执行相当于Python的BeautifulSoup:
classInfo = html.find('div', class_='theClass').get_text()
在斯威夫特。
发布于 2017-08-13 18:16:59
开玩笑的,我发现问题是我没有编辑我的计划。如果我使用Product->Scheme->Pod-projname,我可以导入SwiftSoup。然而,在构建我的项目之后,我发现SwiftSoup不支持Swift 4,因为它使用了Swift 4已经过时的许多功能。
https://stackoverflow.com/questions/45658668
复制相似问题