質問編集履歴

1

エラーの追加

2021/02/24 07:00

投稿

TomSierra
TomSierra

スコア9

test CHANGED
File without changes
test CHANGED
@@ -50,7 +50,47 @@
50
50
 
51
51
  ```
52
52
 
53
+ エラー
54
+
55
+ Traceback (most recent call last):
56
+
57
+ File "C:\Users\81703\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
58
+
59
+ "__main__", mod_spec)
60
+
61
+ File "C:\Users\81703\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
62
+
63
+ exec(code, run_globals)
64
+
65
+ File "c:\Users\81703.vscode\extensions\ms-python.python-2021.2.582707922\pythonFiles\lib\python\debugpy\__main__.py", line 45, in <module>
66
+
67
+ cli.main()
68
+
69
+ File "c:\Users\81703.vscode\extensions\ms-python.python-2021.2.582707922\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 444, in main
70
+
71
+ run()
72
+
73
+ File "c:\Users\81703.vscode\extensions\ms-python.python-2021.2.582707922\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 285, in run_file
74
+
75
+ runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
76
+
77
+ File "C:\Users\81703\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 263, in run_path
78
+
79
+ pkg_name=pkg_name, script_name=fname)
80
+
81
+ File "C:\Users\81703\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 96, in _run_module_code
82
+
83
+ mod_name, mod_spec, pkg_name, script_name)
84
+
85
+ File "C:\Users\81703\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
86
+
87
+ exec(code, run_globals)
88
+
89
+ File "c:\Users\81703\Desktop\作業用\自動写真保存機1号改\自動写真保存機1号.py", line 44, in <module>
90
+
91
+ for media in search.retweeted_status.get('extended_entities','media',[]):
92
+
53
- エラーAttributeError: 'Status' object has no attribute 'get'
93
+ AttributeError: 'Status' object has no attribute 'get'
54
94
 
55
95
  Twitterの画像を習得するためjsonファイルでURLを確認したところたまにretweeted_statusの中にextended_entitiesがあることがあるのですがこれを取得しようとすると上記のエラーが出てしまいます。何か解決策をご存じの方がいらっしゃいましたら教えていただけますでしょうか。
56
96