我是 Instagram Api 的新手。我想弄清楚如何使用 Python 为 InstagramApi 设置代理。以下是我从 github 获得的基本代码。当我执行这段代码时,我得到了一个错误。我想我需要包括代理服务器。
如何在其中包含代理服务器?
from instagram.client import InstagramAPI
access_token="*******************************"
client_secret="******************************"
api = InstagramAPI(access_token=access_token, client_secret=client_secret)
recent_media, next_ = api.user_recent_media(user_id="jey07", count=4)
for media in recent_media:
print(media.caption.text)
我收到以下错误:
File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python36\lib\socket.py", line 713, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it