I am trying to get the html code of the webpage using following code :-
let url = NSURL(string: "http://www.example.com")
var error: NSError?
let html = NSString(contentsOfURL: url!, encoding: NSUTF8StringEncoding, error: &error)
if (error != nil) {
print("whoops, something went wrong")
} else {
print(html!)
}
But i am getting following error in line number 3 ( let html = ....) :-
Argument labels '(contentsOfURL:, encoding:, error:)' do not match any available overloads