ayush-sharma / tweet-toot

This project has moved to:
https://gitlab.com/ayush-sharma/tweet-toot
GNU Affero General Public License v3.0
11 stars 13 forks source link

List index error #6

Closed moonlies closed 5 years ago

moonlies commented 5 years ago

When following the setup guide, it returns the following error after python run.py:

 _info > getTweets() => Fetched tweets for https://twitter.com/accountname.
Traceback (most recent call last):
  File "run.py", line 15, in <module>
    tweets = social.getTweets()
  File "/tmp/tweet-toot/social.py", line 47, in getTweets
    tweet_text = tweet.select('p.tweet-text')[0].get_text()
IndexError: list index out of range
moonlies commented 5 years ago

I made a simple workaround by using try/catch:

try:
    tweet_text = tweet.select('p.tweet-text')[0].get_text()
except:
    tweet_text = 'missing'

It seems to work, but i don't know if it crashes something else.

ayush-sharma commented 5 years ago

I've added the same try-catch, but instead of adding 'missing' it will continue to the next item instead.