回答編集履歴
1
timeout値を設定
test
CHANGED
@@ -16,9 +16,11 @@
|
|
16
16
|
|
17
17
|
url = 'http://日本語.jp/'
|
18
18
|
|
19
|
-
res = req.get(url)
|
19
|
+
res = req.get(url, timeout=2000)
|
20
20
|
|
21
21
|
print(res.encoding)
|
22
|
+
|
23
|
+
# res.contentまたは res.text
|
22
24
|
|
23
25
|
soup = bs(res.content, 'html.parser')
|
24
26
|
|