
ゆるプロ!その20「urlopen」
ゆるいプログラミング講座、略して「ゆるプロ!」
これは気軽に気楽に試せるゆるーいプログラミング学習コンテンツである。今回のお題は「urlopen」
例)urlopen
import urllib.request
response = urllib.request.urlopen("https://www.python.org/")
print(response.read(300))
response.close()
結果)
b'<!doctype html>\n<!--[if lt IE 7]> <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9"> <![endif]-->\n<!--[if IE 7]> <html class="no-js ie7 lt-ie8 lt-ie9"> <![endif]-->\n<!--[if IE 8]> <html class="no-js ie8 lt-ie9"> <![endif]-->\n<!--[if gt IE 8]><!--><html class="no-js"'
参考)
urllib
おわり!