0

How can I get a content of a webpage with the url, after the javascript has been loaded to the html?

I tried let url = NSURL(string: "http://www.myurl.com/") let html = NSString(contentsOfURL: url!, encoding: NSUTF8StringEncoding, error: &error) but its showing only the source of the html page, because the javascript not loaded yet

shbedev
  • 1,875
  • 17
  • 28

1 Answers1

0

NSURLConnection has a delegate: NSURLConnectionDataDelegate, which offers the function connectionDidFinishLoading Check class reference for more information. A similar request has been answered here: NSURLConnection Using iOS Swift

Community
  • 1
  • 1
gutenmorgenuhu
  • 2,312
  • 1
  • 19
  • 33