2016-03-27   python 

Python写経(URLを開く)

参照

urllib.request

import urllib.request as req
import os

with req.urlopen('http://note7.hyuki.net/') as rf:
    with open('output.html', 'w') as wf:
        for line in rf:
            wf.write(line.decode('utf-8'))

os.system('open -a Safari output.html')
 2016-03-27   python