W
W
WebDevMore2020-03-08 13:43:02
Python
WebDevMore, 2020-03-08 13:43:02

How to authorize on the site through Requests?

You need to authorize on the grailed.com website using the requests library, but the problem is that when authorizing on this site, not only the email address and password are sent, but also the recaptcha_token, which is always updated, is it possible to parse this token somehow?
data = {
email: "[email protected]"
password: "example"
recaptcha_token: "The token itself"
recaptcha_type: "invisible"
}

import requests
s = requests.session()
url = 'https://www.grailed.com/api/sign_in'

headers =  {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'}

data = {"email":"[email protected]","password":"example","recaptcha_token": "example", "recaptcha_type":"invisible"}

r = s.post(url, json = data, headers = headers)

print(r.status_code)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2020-03-08
@hottabxp

1) anti-captcha.com
2) Log in with browser and copy cookies (name - 'grailed_jwt', parameter will be a long string). These cookies are passed to the reqeuests'volume. If everything is correct, https://www.grailed.com/api/users/me returns json with information about the user.
3) Selenium (can only be used for authorization, then use requests)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question