Created
March 20, 2014 07:37
-
-
Save utgwkk/9658988 to your computer and use it in GitHub Desktop.
A study of Boo (cf. http://www.atmarkit.co.jp/fdotnet/dotnettips/311webreqres/webreqres.html)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Net | |
import System.Text | |
import System.IO | |
url as string = 'https://www.google.co.jp/' | |
enc as Encoding = Encoding.GetEncoding('UTF-8') | |
req as WebRequest = WebRequest.Create(url) | |
res as WebResponse = req.GetResponse() | |
st as Stream = res.GetResponseStream() | |
sr as StreamReader = StreamReader(st, enc) | |
html as string = sr.ReadToEnd() | |
sr.Close() | |
st.Close() | |
print html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment