samedi 4 avril 2020

Application not getting all text from URL Swift

I am currently working on an app for my dad's business. To make this app work I am going to need to pull text from his website. I have researched the best way to do this and countless people have been using code similar to the code I am using. The problem I am having is that not all the text from the site is being pulled. Only a small portion of the text is getting back to the application.

The website I am pulling data from consists of only the text I need.

Code:

if let web = URL(string: url) {
    do {
        content = try String(contentsOf: web);
        NSLog(content);
        return content;
    } catch {
        print("[ERROR] Web page could not be loaded (URL: \(url))");
    }
}

I'm not sure if there is too much text on the page for the application to pull or if I have to wait longer for all the text to be loaded. If anyone has any suggestions on what could work better for me that would be fantastic.

Thank you for your help




Aucun commentaire:

Enregistrer un commentaire