Python Tweepy:Twitter Api 说/users/lookup 不存在 [英] Python Tweepy: Twitter Api saying that /users/lookup does not exist

查看:47
本文介绍了Python Tweepy:Twitter Api 说/users/lookup 不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个研究应用程序,用于研究具有高权限的 twitter 用户之间的交互.其中一部分是提取有关用户的信息.我使用 Tweepy for Python 构建了一个应用程序,过去 2 天我一直在提取用户信息,没有任何问题.突然收到这样的请求:

<预> <代码> https://api.twitter.com/1.1/users/lookup.json?user_id=14063469%2C175965206%2C116959518%2C19814396%2C59871521%2C15879224%2C53116337%2C60620244%2C22667202%2C56455965%2C40655442%2C6532392%2C24316973%2C21831390%2C19028429%2C28954030%2C31137878%2C16907284%2C16583745%2C9940452%2C19589935%2C935591%2C14602269%2C20546508%2C19773867%2C16082041%2C18320759%2C14084545%2C8731882%2C14795384%2C15664019%2C7417012%2C14634678%2C9269402%2C2348251%2C14573469%2C14441717%2C14451994%2C14412513%2C4084791%2C11922062%2C7080762%2C11916972%2C14449235%2C252192024%2C9067522%2C4084791%2C252192024%2C258597311%2C252192024%2C31920384%2C206028892%2C18495777%2C22663733%2C27221188%2C289510168%2C446444558%2C14540077%2C25195065%2C1705881%2C4084791%2C8937822%2C252192024%2C252192024%2C252192024%2C112627470%2C252192024%2C41906537%2C14822470%2C230684649%2C35758042%2C268838947%2C252192024%2C252192024%2C43303458%2C164029686%2C116950595%2C109449411%2C226911474%2C73931555%2C170619878%2C153925191%2C113826502%2C60094002%2C51161658%2C68858451%2C23453566%2C120360129%2C98659794%2C42160791%2C125832535%2C119379318%2C118153517%2C18596842%2C65443306%2C74994114%2C49875356%2C50401629%2C115960551%2C101979193

我回来了

[{u'message': u'对不起,该页面不存在', u'code': 34}].

有人知道哪里出了问题吗?

解决方案

users_list = api.lookup_users(user_ids=id_list)对于 users_list 中的用户:打印 user.screen_name

您可以试试这个,id_list 是一个用户 ID 列表.你也可以参考tweepy如何从id获取用户名

I'm making a research application which studies interactions between twitter users with high authority. Part of it is extracting information about the users. I built an application using Tweepy for Python and I've been extracting user information for that past 2 days without any porblems. All of a sudden for a request like:

https://api.twitter.com/1.1/users/lookup.json?user_id=14063469%2C175965206%2C116959518%2C19814396%2C59871521%2C15879224%2C53116337%2C60620244%2C22667202%2C56455965%2C40655442%2C6532392%2C24316973%2C21831390%2C19028429%2C28954030%2C31137878%2C16907284%2C16583745%2C9940452%2C19589935%2C935591%2C14602269%2C20546508%2C19773867%2C16082041%2C18320759%2C14084545%2C8731882%2C14795384%2C15664019%2C7417012%2C14634678%2C9269402%2C2348251%2C14573469%2C14441717%2C14451994%2C14412513%2C4084791%2C11922062%2C7080762%2C11916972%2C14449235%2C252192024%2C9067522%2C4084791%2C252192024%2C258597311%2C252192024%2C31920384%2C206028892%2C18495777%2C22663733%2C27221188%2C289510168%2C446444558%2C14540077%2C25195065%2C1705881%2C4084791%2C8937822%2C252192024%2C252192024%2C252192024%2C112627470%2C252192024%2C41906537%2C14822470%2C230684649%2C35758042%2C268838947%2C252192024%2C252192024%2C43303458%2C164029686%2C116950595%2C109449411%2C226911474%2C73931555%2C170619878%2C153925191%2C113826502%2C60094002%2C51161658%2C68858451%2C23453566%2C120360129%2C98659794%2C42160791%2C125832535%2C119379318%2C118153517%2C18596842%2C65443306%2C74994114%2C49875356%2C50401629%2C115960551%2C101979193

I get back

[{u'message': u'Sorry, that page does not exist', u'code': 34}].

Does anyone know what might be wrong?

解决方案

users_list = api.lookup_users(user_ids=id_list)
for user in users_list:
   print user.screen_name

You can try this and the id_list is a list of user IDs. You can also refer to tweepy how to get a username from id

这篇关于Python Tweepy:Twitter Api 说/users/lookup 不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆