Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 尝试提取一条tweet';创建API对象后的id信息_Python_Api_Tweepy - Fatal编程技术网

Python 尝试提取一条tweet';创建API对象后的id信息

Python 尝试提取一条tweet';创建API对象后的id信息,python,api,tweepy,Python,Api,Tweepy,我还是python新手,在创建API对象之后,我试图提取一条推特的id信息。 所以代码是: import tweepy consumer_key = 'hidden' consumer_secret = 'hidden' access_token = 'hidden' access_secret = 'hidden' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_to

我还是python新手,在创建API对象之后,我试图提取一条推特的id信息。 所以代码是:

import tweepy
consumer_key = 'hidden'
consumer_secret = 'hidden'
access_token = 'hidden'
access_secret = 'hidden'

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_secret)

api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True)

# to test it
exp_tweet = api.get_status(archive.tweet_id[1000], tweet_mode = 'extended')
content = exp_tweet._json
Content
输出为:

NameError: name 'archive' is not defined
[enter image description here][1]
如果我拿了这个,我可以在URL中找到它的id,它是“1294917318405836802”

您可以更新代码并尝试检索它

id_ = "1294917318405836802"
exp_tweet = api.get_status(id_, tweet_mode = 'extended')
content = exp_tweet._json
如果我拿了这个,我可以在URL中找到它的id,它是“1294917318405836802”

您可以更新代码并尝试检索它

id_ = "1294917318405836802"
exp_tweet = api.get_status(id_, tweet_mode = 'extended')
content = exp_tweet._json

正如错误所说。您没有任何
存档
initialisedbear请随身携带…我如何初始化它,正如错误所示。您没有带任何
存档文件
initialisedbear请…我如何初始化它