E
E
Evstolyan2021-09-15 20:29:54
Python
Evstolyan, 2021-09-15 20:29:54

How to order a taxi in citymobile using Python?

import requests

headers = {
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 YaBrowser/21.8.2.381 Yowser/2.5 Safari/537.36"
}

data1 = {
    "del_latitude": "55.754429",
    "del_longitude": "37.621014",
    "hurry": "1",
    "latitude": "55.77468083",
    "locale": "ru",
    "longitude": "37.65577947",
    "method": "getprice",
    "options": [],
    "os_version": "web mobile-web",
    "payment_type": "cash",
    "phone_os": "widget",
    "source": "O",
    "tariff_group": "2",
    "ver": "4.59.0"
}

data2 = {
    "brand": "citymobil",
    "locale": "ru",
    "method": "addnewclient",
    "model": "widget",
    "os_version": "web mobile-web",
    "phone": "79278111470",
    "phone_os": "widget",
    "ver": "4.59.0"
}

session = requests.session()
response1 = session.post("https://widget.city-mobil.ru/c-api", headers=headers, data=data1)
print(response1.text)
response2 = session.post("https://widget.city-mobil.ru/c-api", headers=headers, data=data2)
print(response2.text)


Hello ! I need to implement a taxi call function for one bot. Can you please suggest what is wrong in my code? I should receive SMS on my phone after running the program, but this does not happen (

Site: https://city-mobil.ru/

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Developer, 2021-09-15
@samodum

Contact the support service of this taxi company

O
Old_TyT, 2021-09-16
@Old_TyT

You will most likely need this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question