[問題] 抓網頁最後會輸出什麼樣的東西?
>>> import urllib.request as url
>>> fh = url.urlopen('http://www.tzuchi.org.tw')
>>> content = fh.read().decode('utf-8')
>>> with open('test','w') as fd:
... fd.write(content)
File "<stdin>", line 2
fd.write(content)
^
IndentationError: expected an indented block
>>> fd.write(content)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'fd' is not defined
>>>
請問IndentationError是什麼意思?是慈濟網站阻擋下來了嗎?
--
http://dicky.twbbs.org/
╔O ╔╗+ ╭╮O ╔╗╔╗ ★ O
║║ ║║ ╰╯。 O║║║。O
║║ ║║╔═O╦╦═╗O║╚╝╠═╦╦╗
║║☆║╚╣║║│║╩╣ ╚╗╔╣║║║║
╚╝ O═╩═╩═╩═╝★ ╚╝╚═╩═O
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.122.36.82
推
10/13 22:40, , 1F
10/13 22:40, 1F
推
10/13 22:58, , 2F
10/13 22:58, 2F
→
10/13 23:04, , 3F
10/13 23:04, 3F
→
10/14 00:02, , 4F
10/14 00:02, 4F
→
10/14 00:15, , 5F
10/14 00:15, 5F
→
10/14 08:04, , 6F
10/14 08:04, 6F
→
10/14 08:48, , 7F
10/14 08:48, 7F