回答編集履歴
1
サンプルコード修正
test
CHANGED
@@ -14,18 +14,20 @@
|
|
14
14
|
|
15
15
|
import socket
|
16
16
|
|
17
|
-
|
17
|
+
urls = ['http://www.google.co.jp','https://t.co/U1QHEjDRhc']
|
18
18
|
|
19
|
-
url
|
19
|
+
for url in urls:
|
20
20
|
|
21
|
-
tr
|
21
|
+
print(url)
|
22
22
|
|
23
|
-
|
23
|
+
try:
|
24
24
|
|
25
|
-
|
25
|
+
urllist = (urllib.request.urlopen(url,timeout=3).geturl())
|
26
26
|
|
27
|
-
|
27
|
+
print(urllist)
|
28
28
|
|
29
|
+
except socket.timeout:
|
30
|
+
|
29
|
-
print('timeout')
|
31
|
+
print('timeout')
|
30
32
|
|
31
33
|
```
|