swift - Do something after WKWebView has finished loading and scraping specific page -




what i'm trying perform action after wkwebview i'm using has finished loading , scraping page.

here's code webview:

    let webview = wkwebview()      let url = url(string: "https://web.spaggiari.eu/home/app/default/menu_webinfoschool_genitori.php?custcode=")!         let request = urlrequest(url: url)         webview.load(request) 

what want show button "connect" after process has fished (that specific process , not when webview finishes loading every time). i'm using dispatchqueue wait seconds hoping page loads in time.

 dispatchqueue.main.asyncafter(deadline: .now() + .seconds(4)) {              uiview.animate(withduration: 0.8, animations: {                 self.registerbutton.alpha = 1                 self.registerbutton.isenabled = true             })             uiview.animate(withduration: 0.8, delay: 0.4, animations: {                 self.blurbutton.alpha = 1             })         } 

i'm using xcode swift3

this code indicates page loaded, may you

func webpagefullyloaded(_ str: string) {       if (str == "complete") || (str == "interactive") {          print("page loaded")      } }  func webviewdidfinishload(_ webview: uiwebview) {       webpagefullyloaded(webview.stringbyevaluatingjavascript(from: "document.readystate")) } 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -