Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- got exception:
- 'SearchResults' object has no attribute 'text'
- # coding:UTF-8
- import tweepy
- import time
- while True:
- CONSUMER_KEY = '***********'
- CONSUMER_SECRET = '******************************'
- auth = tweepy.OAuthHandler(CONSUMER_KEY,CONSUMER_SECRET)
- ACCESS_TOKEN = '***********************'
- ACCESS_SECRET = '*******************************'
- auth.set_access_token(ACCESS_TOKEN,ACCESS_SECRET)
- api = tweepy.API(auth)
- search = api.search(q='#紙飛行機',lang='ja',count=10)
- try:
- api.update_status(search.text)
- except AttributeError as e:
- print("got exception:")
- print(e)
- time.sleep(30)
- search = api.search(q='#紙飛行機',lang='ja',count=10)
- for s in search:
- api.update_status(s.text)
Add Comment
Please, Sign In to add comment