0
私はpython-instagramを使ってタグの検索と返却を行っています。python-instagramを使ってタグを検索して戻り場所
私はエラーが供給しています: はAttributeError:私はいくつかの構文解析をしています
from instagram.client import InstagramAPI
client_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
access_token="xxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
api = InstagramAPI(client_id=client_id, client_secret=client_secret,access_token=access_token)
tag = 'wtcampus'
search= api.tag_recent_media(tag_name=tag)
if ['location'] is not None:
for media in search:
print media.location.point.latitude
print media.location.point.longitude
Imは確信:「リスト」オブジェクトは、ここでは何の属性「場所」
は、私が試したものではありませんしました次のテストを実行した後のロケーションオブジェクト...
count = 0
if ['location'] is not None:
for media in search:
count = count + 1
print count
次の2つが返されます。これらのオブジェクトの緯度と経度はどうですか?
@Lukasz Salitraの入力をありがとう。同じエラー:AttributeError: 'list'オブジェクトには属性の場所がありません。 :/ – remmi11
@ remmi11 'search'の出力は何ですか?ちょうどそれを印刷し、その中に何が入っているかを見てください –
'[location ']がNoneでない場合:print search'が返す([]、None) – remmi11