gpt4 book ai didi

python - instabot bot.searchUsers() 返回 True 而不是值

转载 作者:太空宇宙 更新时间:2023-11-03 14:36:09 26 4
gpt4 key购买 nike

我正在使用instabot python 模块与 instagram API 一起使用,我正在尝试搜索用户名,但是当我尝试时它总是返回 True 而不是结果值,这是我的代码:

bot = Bot()    
bot.login(username="mytest_user", password="my_pass")
users = bot.searchUsers(query="test")
print "==========%s" % users

它返回:

2017-10-26 01:23:48,153 - INFO - Login success as mytest_user!
========== True

我错过了什么吗?

最佳答案

bot.searchUsers() 返回 bool 值。

你的函数必须是这样的:

bot.searchUsers('your_query_to_search_usernames')
jsondata = bot.LastJson
for username in jsondata['users']:
print(username['username']

它会起作用。

关于python - instabot bot.searchUsers() 返回 True 而不是值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46943746/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com