简体   繁体   English

如何使用 python 在 Instagram 上发布图片

[英]How to post a picture on instagram using python

I want to post a picture on instagram using python but i don't know how to do it.我想使用 python 在 instagram 上张贴图片,但我不知道该怎么做。 Thanks in advance.提前致谢。 i do this我这样做

But this was a fail但这是一个失败

from instapy_cli import client
def post_instagram():
    capture()
    username = 's' 
    password = '' 
    image = 'photo.png'
    speak("what is the caption?")
    caption = command()
    text = "nice"
    with client(username, password) as cli:
        cli.upload(image, text)

Remove capture() and caption= command() and your code works fine.删除capture()caption= command()并且您的代码工作正常。 Like this像这样

from instapy_cli import client

username = ' YOUR USERNAME'
password = 'YOUR PASSWORD'
image = 'image.jpg'
text = "nice"

with client(username, password) as cli:
    cli.upload(image, text)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM