使用Python将图片上传到instagram [英] Upload images to instagram using Python
问题描述
我正在尝试做一个简单的Instagram python机器人,以便在我的Instagram个人资料中上传图像.我已经尝试过最常用的库(InstagramAPI,instapy,insta-cly).在搜索时,我发现Instagram进行了一些更改,使这些库毫无用处.
I'm trying to do a simple Instagram python bot in order to upload images in my Instagram profile. I've already tried the most common libraries (InstagramAPI, instapy, insta-cly). While I was searching I found out that Instagram has changed something making those libraries useless.
我可以使用任何图书馆吗?我知道我可以使用Selenium来实现它,但是我想知道是否有任何捷径.
Is there any library I can use? I know thatI can use Selenium in order to make it go but I'm wondering if there is any shortcut.
Trank you!
Trank you!
推荐答案
尝试该库:instabot https://pypi.org/project/instabot/
try this library: instabot https://pypi.org/project/instabot/
用于上传图片的代码示例:
example of code for uploading an image:
from instabot import Bot
bot = Bot()
bot.login(username="instagram_username", password="your_password")
file = open('path_to_your_image', 'r')
bot.upload_photo(file, caption="your post caption")
这篇关于使用Python将图片上传到instagram的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!