Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*
Usad siempre el inicializador init(contentsOf:encoding:) en lugar
de init(contentsOf:).
Parece que si no especificas una codificación no funciona.
*/
import Foundation
if let url = URL(string: "http://desappstre.com"), let html = try? String(contentsOf: url, encoding: .utf8)
{
print(html)
}
/*
<html>
<head>
<title>desappstre {eStudio}</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<link href="style/skeleton.css" rel="stylesheet" type="text/css" media="screen">
<link href="style/desappstre.css" rel="stylesheet" type="text/css" media="screen">
...
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.