Instabot向用户发送其他不需要的消息。如何解决此错误?
import os
# to delete config folder (throws error if not done)
if os.path.isfile("path/to/file/config"):
os.remove("path/to/file/config")
from instabot import Bot
import pandas as pd
# Creating bot varible
bot = Bot()
# Login
bot.login(username="useername", password="password")
# Get list of users
user_list = pd.read_excel('data/UserList.xlsx')
users = user_list['Username']
names = user_list['Full Name']
# Message
text = "Test"
# Iterate through and send to every user on list of users
for i in range(len(users)):
# Sending messages
bot.send_messages(text, users[i])
# print confirmation
print("Message sent to " + names[i])
我正在尝试在上面的Python程序中使用Instabot将DMS自动发送到从Excel文件中找到的用户列表。我目前在Excel表上有3个帐户列表,但是在运行脚本时,Instabot会向未在Excel表上列出的用户发送多个其他消息。
2022-06-20 11:40:05,977 - INFO - Going to send 23 messages.
4%|████▋ | 1/23 [00:01<00:32, 1.49s/it]
4%|████▋ | 1/23 [00:02<00:47, 2.15s/it]
有什么方法可以解决此问题吗?
import os
# to delete config folder (throws error if not done)
if os.path.isfile("path/to/file/config"):
os.remove("path/to/file/config")
from instabot import Bot
import pandas as pd
# Creating bot varible
bot = Bot()
# Login
bot.login(username="useername", password="password")
# Get list of users
user_list = pd.read_excel('data/UserList.xlsx')
users = user_list['Username']
names = user_list['Full Name']
# Message
text = "Test"
# Iterate through and send to every user on list of users
for i in range(len(users)):
# Sending messages
bot.send_messages(text, users[i])
# print confirmation
print("Message sent to " + names[i])
I am trying to use Instabot in the python program above to automatically send DMs to a list of users found from an excel file. I currently have 3 accounts list on the excel sheet but when running the script, instabot sends multiple additional messages to users who are not listed on the excel sheet.
2022-06-20 11:40:05,977 - INFO - Going to send 23 messages.
4%|████▋ | 1/23 [00:01<00:32, 1.49s/it]
4%|████▋ | 1/23 [00:02<00:47, 2.15s/it]
Is there any way to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论