SwiftSoup支持Swift 4.0嗎?我已經初始化了我的Podfile,並在運行pod安裝之前按照SwiftSoup GitHub repo https://github.com/scinfu/SwiftSoup的指示添加了「SwiftSoup」,但我無法將其導入Swift文件。我在XCode中使用.xcworkspace文件,因爲SwiftSoup README指示的不是.xcodeproj工作區。SwiftSoup支持Swift 4
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對雨燕4.0的支持,沒有任何人有,我可以使用其它方法嗎?我試圖解析一個包含HTML的Swift字符串對象,以刪除所有腳本標記並提取具有特定類的div標記。
基本上我試圖做Python的BeautifulSoup條命令相當於:
classInfo = html.find('div', class_='theClass').get_text()
。
from pod 1.5.2版本swift 4支持 – Scinfu