質問編集履歴

1

エラーを修正しました。

2018/02/22 00:54

投稿

date-07
date-07

スコア13

test CHANGED
File without changes
test CHANGED
@@ -7,6 +7,8 @@
7
7
 
8
8
 
9
9
  # コード
10
+
11
+ '''
10
12
 
11
13
  def __init__(self):
12
14
 
@@ -22,19 +24,39 @@
22
24
 
23
25
  urllib.request.install_opener(opener)
24
26
 
25
-
27
+ '''
26
28
 
27
29
  ツール起動時にcookiesをロードし、
28
30
 
29
-
31
+ '''
30
32
 
31
33
  def __del__(self):
32
34
 
33
35
  self.cj.save(self.cookie_file)
34
36
 
35
-
37
+ '''
36
38
 
37
39
  と終了時にsaveしたいのですが、
40
+
41
+ Traceback (most recent call last):
42
+
43
+ File "test.py", line 296, in <module>
44
+
45
+ hoge.test(url)
46
+
47
+ File "test.py", line 278, in hoge
48
+
49
+ display(soup)
50
+
51
+ NameError: name 'display' is not defined
52
+
53
+ Exception ignored in: <bound method test.__del__ of <__main__.testobject at 0x0000029B0E4BA1D0>>
54
+
55
+ Traceback (most recent call last):
56
+
57
+ File "test.py", line 95, in __del__
58
+
59
+ File "C:\Users\lib\http\cookiejar.py", line 1875, in save
38
60
 
39
61
  NameError: name 'open' is not defined
40
62