Fixing bug where tweet text cannot be found in HTML structure
parent
91a325e937
commit
74bc7398bb
11
social.py
11
social.py
|
@ -45,7 +45,16 @@ def getTweets():
|
|||
for tweet in timeline:
|
||||
|
||||
tweet_id = tweet['data-item-id']
|
||||
tweet_text = tweet.select('p.tweet-text')[0].get_text()
|
||||
|
||||
try:
|
||||
|
||||
tweet_text = tweet.select('p.tweet-text')[0].get_text()
|
||||
|
||||
except:
|
||||
|
||||
helpers._info('getTweets() => No tweet text found. Moving on...')
|
||||
|
||||
continue
|
||||
|
||||
all_tweets.append({"id": tweet_id, "text": tweet_text})
|
||||
|
||||
|
|
Loading…
Reference in New Issue