My question is how can i tell my application to for example go to this website search for a specefic link and download the content how should perform such thing in swift?
Asked
Active
Viewed 73 times
-1
-
Rather than going to a website and searching for the link, if you know the link beforehand, consider simply downloading the file directly using a library like [Alamofire](https://github.com/Alamofire/Alamofire) – Ronak Shah Aug 31 '18 at 22:46
-
No i dont know the link thats it i want to get it from a page i want to have a some kind of link extractor for my app user searchs something and gets it link some kind of self buid api for a website that dosent provide the api – namaama Sep 01 '18 at 00:20
1 Answers
1
You could use Kanna to parse the website for the link you are looking for, then download the file using Alamofire. If you want another way to download a file, here's a relevant Stack Overflow link: How to download file in swift?

Ronak Shah
- 936
- 9
- 17
-
Kanna can search website ? I had a downloader class but just want to extract links from websites – namaama Sep 01 '18 at 00:17
-
@namaama what you'll want to do is use the xml parser to look for the element you want – Ronak Shah Sep 01 '18 at 05:55
-
@namaama this link will help: https://www.twilio.com/blog/2016/08/web-scraping-and-parsing.html-in-swift-with-kanna-and-alamofire.html – Ronak Shah Sep 01 '18 at 05:56