Click here to Skip to main content
15,905,590 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
After print(html) I got clear HTML without data.

Swift
import UIKit
import WebKit
class ViewController: UIViewController,WKNavigationDelegate{


    let webView = WKWebView()

    func webView(_ webView: WKWebView,
                 didFinish navigation: WKNavigation!) {
        print("loaded")
        webView.evaluateJavaScript("document.documentElement.innerHTML.toString()",
                                   completionHandler: { (html: Any?, error: Error?) in
                                    print(html)

        })

    }

    override func viewDidLoad() {
        super.viewDidLoad()
        let url = URL (string: "https://mobile.[DELETED].com")
        let request = URLRequest (url:url!)
        webView.frame = CGRect (x:0,y:0,width:300,height:300)
        webView.navigationDelegate = self

        webView.load(request)
        view.addSubview(webView)

    }
}


What I have tried:

i search google for problem but nothing find
Posted
Updated 10-Aug-18 4:08am
v2
Comments
OriginalGriff 10-Aug-18 10:09am    
Please do not post URLs for places like casino sites: it makes you look like a spammer, and that will get you thrown off the site very quickly. I have removed the spam-like addresses from your post to prevent that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900