Skip to content

Instantly share code, notes, and snippets.

@molcay
Last active November 18, 2020 13:39
Show Gist options
  • Save molcay/bfe8736c12cc3c5d9c52dab27fc5954d to your computer and use it in GitHub Desktop.
Save molcay/bfe8736c12cc3c5d9c52dab27fc5954d to your computer and use it in GitHub Desktop.
Bazı siteler için toplam harcanan paranın miktarının bulan scriptler

UYARI: Önce sayfa sonuna kadar inip, bütün paralar görünmesini sağlayınız. Bütün paraların göründüğünden emin olduktan sonra Geliştirici Araçlarından JS Konsolu açıp, ilgili sitenin scriptini yapıştırıp ne kadar harcadığınızı görebilirsiniz.

  • YemekSepeti:
[...document.querySelectorAll('div.order-item > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > strong:nth-child(1)')].map(e => Number.parseFloat(e.innerText.replace('TL', ''))).reduce((acc, cur) => acc + cur, 0)
  • Hepsiburada:
[...document.querySelectorAll('div.order-block > div > div:nth-child(1) > div:nth-child(4) > b:nth-child(1)')].map(e => Number.parseFloat(e.innerText.replace(' TL', '').replace('.', '').replace(',', '.'))).reduce((acc, cur) => acc + cur, 0)
  • Trendyol:
[...document.querySelectorAll('.order-section .order-parent-header > div:nth-child(3) > div.number')].map(e => Number.parseFloat(e.innerText.replace(' TL', '').replace('.', '').replace(',', '.'))).reduce((acc, cur) => acc + cur, 0)

  • Pluralsight Course ID extract in a path page:
[...document.querySelectorAll('.item---603xc.oneQuarter---pz6fI .card---1vXvd>div>div>span>a')].map(a => a.href.replace('https://app.pluralsight.com/library/courses/', '')).join("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment