Skip to content

Instantly share code, notes, and snippets.

@bsevgin
Last active June 6, 2024 22:05
Show Gist options
  • Save bsevgin/0bf34f0956770888ec235e88062a5cb8 to your computer and use it in GitHub Desktop.
Save bsevgin/0bf34f0956770888ec235e88062a5cb8 to your computer and use it in GitHub Desktop.
CS:GO Get Steam Market Items Total Price
var totalPrice = 0;
const elements = document.querySelectorAll('span .market_listing_price span span:last-child');
Array.from(elements).forEach((element, index) => {
var text = element.innerText;
var amount = text.replace(/\(/g, '').replace(/ USD/g, '').replace(/\)/g, '').replace(/\$/g, '');
totalPrice += parseFloat(amount);
});
console.log(totalPrice.toFixed(2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment