自动化instagram注册与python请求

问题描述 投票:0回答:1

我是使用请求和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 = '[email protected]'
    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') 
python automation http-post python-requests instagram
1个回答
3
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.