[英]Get a content of webpage after javascript is loaded SWIFT
将javascript加载到html后,如何获取带有url的网页内容?
我尝试let url = NSURL(string: "http://www.myurl.com/") let html = NSString(contentsOfURL: url!, encoding: NSUTF8StringEncoding, error: &error)
但它仅显示html页面的来源,因为尚未加载javascript
NSURLConnection有一个委托:NSURLConnectionDataDelegate,它提供函数connectionDidFinishLoading
Check 类参考以获取更多信息。 此处已回答了类似的请求: 使用iOS Swift的NSURLConnection
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.