samedi 28 novembre 2020

My goal is it to build a bot, but I am struggeling with the adding to cart process. Why does it not work?

I would like to build software to automatically checkout any product on https://www.mueller.de/. With the script, I have the response I get is 403. Why is this the case? I do not know what went wrong. Can somebody help me? This is the product I want to buy https://www.mueller.de/p/pokemon-sammelkartenspiel-pokemon-tin-88-pikachu-v-2658524/ . Basically, the first step I want to solve is that I can add the product to my cart by using request. Is it because of missing cookies?

import requests

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"}

post_data = {"categoryId": "15249460","delivery": "delivery_market","itemId": "2658524","productId": "2658524","quantity": "1","_csrf": "c60af17b-4a19-4d0d-a4b4-1237b36ca3b7"}

url = "https://www.mueller.de/basket/cc/add/"

add_to_cart = requests.post(url, headers=headers, data=post_data)

print (add_to_cart)



Aucun commentaire:

Enregistrer un commentaire