自动化instagram注册与python请求

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了自动化instagram注册与python请求相关的知识,希望对你有一定的参考价值。

我是使用请求和python的新手,我只是想测试水域。我只是想在www.instagram.com上自动化注册表单。我不太确定我做错了什么,所有的帮助都表示赞赏。提前致谢!

以下是请求标头:https://gyazo.com/032e97dbcd72f5d782488ad252919758?token=c15f8644eb1f0e40b001f50995d74c23

这是表单数据:https://gyazo.com/53a154adc0c16ba17f4f9199949cb465

最后,这是我到目前为止的代码:

import requests

with requests.Session() as c:
    url = 'https://www.instagram.com'

    EMAIL = 'testafhsdfh38@gmail.com'
    PASSWORD = 'testpass1234' 
    USERNAME = 'blsdh37fgtest'
    NAME = 'Jon Doe'


    c.get(url)
    csrftoken = c.cookies['csrftoken']

    login_data = dict(csrftoken=csrftoken, email=EMAIL, password=PASSWORD, username=USERNAME, fisrt_name=NAME, seamless_login_enabled=1)
    c.post(url, data=login_data, headers={"Referer": "https://www.instagram.com"})
    page = c.get('https://www.instagram.com/?hl=en#registered') 
答案

我不能添加评论(少于50),但从我看到的,你不是发送POST请求到https://www.instagram.com/accounts/web_create_ajax/,但对于http://www.instagram.com这可能是一个问题,因为Instagram的/ url路由不知道如何处理你的POST请求的数据。可能还有其他问题,但这就是我最初发现的问题。

再次 - 这更适合评论,但我想帮助,我不能评论,直到我至少+50代表。

以上是关于自动化instagram注册与python请求的主要内容,如果未能解决你的问题,请参考以下文章

向下滚动列表 instagram selenium 和 python

IOS 应用程序中的 instagram 集成中的“重定向 URI 与注册的重定向 URI 不匹配”

Python Instagram 自动记录器

将 App Flutter 与 API instagrame 连接发布评论

Oauth2 Instagram API“重定向 URI 与注册的重定向 URI 不匹配”

KeyError:使用 Python Instagram API 客户端的“数据”