I'm using the Kanna framework to use xpath parsing. I'm successfully getting text from my desired url using the following code:
@IBAction func getSource(sender: AnyObject) {
if let doc = Kanna.HTML(url: (NSURL(string: "http://qwertz.com")!), encoding: NSUTF8StringEncoding) {
// Search for nodes by XPath
for link in doc.xpath(".//*[@id='bday_form']/div[1]/img[1]") {
print(link.text)
print(link["href"])
self.testLabel.text = link.text
}
}
print("test22")
}
How can I parse images and put them into my imageView Outlet @IBOutlet weak var imageViewOutlet: UIImageView!
Help is very appreciated.
self.imageViewOutlet.image = link
throws: Cannot assign value of type 'XMLElement' to type 'UIImage?'