0
我一直試圖'點擊'網站上的請求模塊上的按鈕,但我不能得到它的工作。Python點擊按鈕與請求
這是網站上的按鈕:
<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>
這是我一直想在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)
登錄部分工作正常,只是最後一部分(從值2)不起作用。