After calling this method, the array of XMLElement is obtained, and it can be printed normally in the current method, but after the return value is obtained, when the getElements method is called, an error will be reported when arr is printed
Fuzi/Node.swift:122: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
Fuzi/Node.swift:122: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
Fuzi/Node.swift:122: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
Fuzi/Node.swift:122: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
Description:
After calling this method, the array of XMLElement is obtained, and it can be printed normally in the current method, but after the return value is obtained, when the getElements method is called, an error will be reported when arr is printed
Fuzi/Node.swift:122: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value Fuzi/Node.swift:122: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
ele.attr("href") === ""
ele.stringValue == ""
private func getResult(_ xPath: String) -> Array {
let node : Fuzi.HTMLDocument = htmlNode
}
ele.stringValue == "test 1"
Fuzi/Node.swift:122: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value Fuzi/Node.swift:122: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
ele.attr("href") === ""
ele.stringValue == ""
Environment
Package Manager:
Fuzi version:3.1.3
Xcode version:15.0.1
How to reproduce:
xpath