I am trying to create a post request to send a message on the site. But for some reason it doesn't work. I am on the right page, but for some reason the message is still not being sent
print(f'{login}', lastChat['userSms'])
Jurl = 'https://funpay.com/chat/?node=userId'
seska = session.get(Jurl )
soup = BeautifulSoup(seska.text, 'lxml')
tag1 = soup.find('div', id='live-counters').get('data-orders')
tag3 = soup.find('div', class_='chat chat-float').get('data-bookmarks-tag')
tag2 = soup.find("div", class_='chat chat-float').get('data-tag')
tag4 = soup.find('div', class_='param-item chat-panel hidden').get('data-tag')
session.get(Jurl)
dataMes = soup.findAll('div', class_='message')
print(dataMes[-1])
objects = '[{"type":"orders_counters","id":"5214431","tag":"' + tag1 + '","data":false},' \
'{"type":"chat_node","id":"users-5054677-5214431","tag":"' + tag2 + '",' \
'"data":{"node":"users-5054677-5214431","last_message":' + lastMes + ',"content":"s"}},' \
'{"type":"chat_bookmarks","id":"5214431","tag":"' + tag3 + '","data":false},' \
'{"type":"c-p-u","id":"5054677","tag":"' + tag4 + '","data":false}]'
request = '{"action":"chat_message",' \
'"data":{"node":"users-5054677-5214431",' \
'"last_message":' + lastMes + ',"content":"s"}}'
datas = {
"objects": objects,
"request": request,
"csrf_token": csrf
}
print(datas)
session.post(Jurl, data=datas)