I have been trying to 'click' a button on a site with the requests module on a website, but I can't get it working.
This is the button on the site:
<div data-expected-currency="1" data-asset-type="T-Shirt" class="btn-primary btn-medium PurchaseButton " data-se="item-buyforrobux" data-item-name="T-Shirt" data-item-id="307054354" data-expected-price="2" data-product-id="28239339" data-expected-seller-id="96294876" data-bc-requirement="0" data-seller-name="All Player Clothing">
Buy with R$
</div>
This is what I've been trying to do in Python:
urlattempt = 'https://www.roblox.com/NewLogin'
values = {'Username': 'USER',
'Password': 'PASSWORD',
'action': 'login'}
rpost = requests.post(urlattempt, data=values)
cookies = rpost.cookies
values2 = {'action': 'btn-primary btn-medium PurchaseButton'}
rpost2 = requests.post('https://www.roblox.com/item.aspx?id='+price2, cookies=cookies, data=values2)
The login part works fine, it's just the last part (from values2) that doesn't works.