You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
check_num = 0
user_prob = []
for k in df_acc_list:
user_id_store = []
check_num = check_num + 1
try:
user_following3 = client.get_user_following(k)
except:
print(str(k) + ' was a problem.')
user_prob.append(k)
time.sleep(20)
continue
for i in range(len(user_following3)):
try:
des_url = user_following3[i].description_urls[0]['expanded_url']
except:
des_url = None
user_id_store.append({
'User_ID':k,
'Following_ID': user_following3[i].id,
'Verified': user_following3[i].is_blue_verified,
'User_Description': user_following3[i].description,
'Description_URL': des_url,
'Like_Count': user_following3[i].favourites_count,
'Follower_Count': user_following3[i].followers_count,
'Friend_Count': user_following3[i].following_count,
'Location': user_following3[i].location,
'UserName': user_following3[i].name,
'ScreenName': user_following3[i].screen_name,
'Total_Posts':user_following3[i].statuses_count,
'User_Verified': user_following3[i].verified
})
time.sleep(20)
if check_num%100 == 0:
time.sleep(60*3)
For some accounts client.get_user_following(k) throws IndexError: list index out of range. Checked with two different versions 1.3.16 and 1.4.7.
Error Message:
IndexError Traceback (most recent call last)
/tmp/ipykernel_162588/1999871064.py in <module>
----> 1 client.get_user_following(user_id = '370279585')
~/anaconda3/lib/python3.9/site-packages/twikit/client.py in get_user_following(self, user_id, count, cursor)
2472 A list of User objects representing the users being followed.
2473 """
-> 2474 return self._get_user_friendship(
2475 user_id,
2476 count,
~/anaconda3/lib/python3.9/site-packages/twikit/client.py in _get_user_friendship(self, user_id, count, endpoint, cursor)
2367 entry_id = item['entryId']
2368 if entry_id.startswith('user'):
-> 2369 user_info = find_dict(item, 'result')[0]
2370 results.append(User(self, user_info))
2371 elif entry_id.startswith('cursor-bottom'):
IndexError: list index out of range
The text was updated successfully, but these errors were encountered:
For some accounts client.get_user_following(k) throws IndexError: list index out of range. Checked with two different versions 1.3.16 and 1.4.7.
Error Message:
The text was updated successfully, but these errors were encountered: