A
A
Apache2020-11-05 22:41:26
Python
Apache, 2020-11-05 22:41:26

Can't make a purchase using request?

UPD

Code
import requests
from bs4 import BeautifulSoup as BS

s = requests.session()

r = requests.get('https://skinkeen.ru/vintovka-cs-go/ak-47/ak-47-kartel-zakalyonnoe-v-boyah/')
pack = BS(r.content, 'html.parser')
csrf = pack.select('input[name=_csrf-frontend]')[0]['value']
inv = pack.select('input[name=inventory]')[0]['value']
fprice = pack.select('input[name=fprice]')[0]['value']


buy = {
    '_csrf-frontend':csrf,
    'inventory':inv,
    'fprice':fprice
}

add_to_inv = s.post('https://mc.yandex.ru/webvisor/49402951?wmode=0&rn=1027411458&page-url=https%3A%2F%2Fskinkeen.ru%2Fvintovka-cs-go%2Fak-47%2Fak-47-kartel-zakalyonnoe-v-boyah%2F&wv-type=5&wv-hit=68996552&wv-part=6&browser-info=ti%3A8%3Aet%3A1604666074%3Aw%3A773x667%3Av%3A1964%3Az%3A180%3Ai%3A20201106153250%3Ast%3A1604666077%3Au%3A1602695566242862165%3App%3A3629563401', data=buy)
print(add_to_inv)

I'm sending a post request via a link, I don't know if this is exactly the link, because in the post request that is sent when you click the buy button, it goes to https://skinkeen.ru/vintovka-cs-go/ak-47/ak- 47 car...
Doc-in
Request URL: https://skinkeen.ru/vintovka-cs-go/ak-47/ak-47-kar...

Then there are post files without Form data, I send a post request to one of them. I tried to send to all 4, for each separately, the purchase is not made, but the code 200 is returned. When I try to send a post to https://skinkeen.ru/vintovka-cs-go/ak-47/ak-47-kar. .. , returns 404
2 Hypotheses:
1 It's that I'm sending data to the wrong place.
2 When request sends data, it is not logged into the profile.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Antonio Solo, 2020-11-06
@solotony

use postman to debug requests . conveniently. and then translate the already working request into the program


2 When request sends data, it is not logged into the profile.

naturally. this is the first thing to check (do)

V
Viktor Kokorich, 2020-11-06
@66656665

In any case, you will need postman

A
AlexBoss, 2020-11-06
@AlexBoss

And here is postman, open Devtools in chrome and see where they go.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question