i've been struggling for some time right now trying to find how to make this faster somehow
the code
def get_resellers(sellerid, price, userassetid, id):
data = {"expectedCurrency":1,"expectedPrice":price, "expectedSellerId":sellerid,"userAssetId":userassetid}
headers = {"X-CSRF-TOKEN":csrftoken}
k = requests.post(f"https://economy.roblox.com/v1/purchases/products/{id}", data=data, headers=headers, cookies=cookies)
def check_price(id):
while True:
try:
t0 = time.time()
soup = BeautifulSoup(requests.get(f"https://www.roblox.com/catalog/{id}").content, 'html.parser')
data_expected_price, data_expected_seller_id, data_userasset_id = soup.select_one('[data-expected-price]')['data-expected-price'], soup.select_one('[data-expected-seller-id]')['data-expected-seller-id'], soup.select_one('[data-lowest-private-sale-userasset-id]')['data-lowest-private-sale-userasset-id']
t1 = time.time()
total = t1 - t0
print(total)
if int(data_expected_price) < 0.7*int(data_expected_price):
get_resellers(data_expected_seller_id, data_expected_price, data_userasset_id, id)
except:
pass
is there any faster way to do it or extract the stuff, or make the http request etc. anything can help! also: it takes like 0.7 seconds to buy and price check since it needs to load the site everytime is there anyway to do it faster?