質問編集履歴

3

エラー文の全文を載せました。

2019/10/16 08:48

投稿

yuchin.
yuchin.

スコア7

test CHANGED
File without changes
test CHANGED
@@ -44,6 +44,18 @@
44
44
 
45
45
 
46
46
 
47
+ 以下がエラー文の全体です。
48
+
49
+ `Traceback (most recent call last):
50
+
51
+ File "c:/Users/Yuchi/Desktop/IRomiru_Development/xbrl-parser.py", line 13, in <module>
52
+
53
+ current_year_assets = edinet_xbrl_object.get_data_by_context_ref(key, context_ref).get_value()
54
+
55
+ AttributeError: 'NoneType' object has no attribute 'get_value'`
56
+
57
+
58
+
47
59
  しかし、何がどうなっているのかさっぱりでわかりません。
48
60
 
49
61
  デバッグの仕方もわからず戸惑っています。

2

コメントを追加しました。

2019/10/16 08:48

投稿

yuchin.
yuchin.

スコア7

test CHANGED
File without changes
test CHANGED
@@ -38,7 +38,15 @@
38
38
 
39
39
 
40
40
 
41
+ 実行してもAttributeErrorがでます。
42
+
41
43
  エラー文を見る限りでは、下から2行目の.get_data_by_context_ref付近でNoneを返していることが原因らしいとわかりました。
44
+
45
+
46
+
47
+ しかし、何がどうなっているのかさっぱりでわかりません。
48
+
49
+ デバッグの仕方もわからず戸惑っています。
42
50
 
43
51
 
44
52
 

1

コードの部分を修正しました。

2019/10/16 00:55

投稿

yuchin.
yuchin.

スコア7

test CHANGED
File without changes
test CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  ## parse xbrl file and get data container
22
22
 
23
- xbrl_file_path = "set your xbrl file path"
23
+ xbrl_file_path = r'C:\Users\Yuchi\Desktop\IRomiru_Development\TOYOTA\jpcrp020300-srs-001_E02144-000_2017-03-31_01_2017-08-04.xbrl'
24
24
 
25
25
  edinet_xbrl_object = parser.parse_file(xbrl_file_path)
26
26
 
@@ -30,7 +30,7 @@
30
30
 
31
31
  key = "jppfs_cor:Assets"
32
32
 
33
- context_ref = "CurrentYearInstant"
33
+ context_ref = "2018"
34
34
 
35
35
  current_year_assets = edinet_xbrl_object.get_data_by_context_ref(key, context_ref).get_value()
36
36