Created
May 13, 2024 03:24
-
-
Save tronghieu60s/0a4fef1fac38368c6c9bf64ed6b4a0f8 to your computer and use it in GitHub Desktop.
lấy đơn vị tiền tệ tiếng việt tại trang https://wise.com/vn/currency-converter/currencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.from(document.querySelectorAll('div[aria-label="currency-group"] a')).map(item => ({currency: item.querySelector("h5").innerText, name: item.querySelector("p").innerText, flag: window.getComputedStyle(item.querySelector(".currency-flag")).getPropertyValue('background-image').slice(4, -1).replace(/"/g, "")})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Filter support currency in js Intl
Array.from(document.querySelectorAll('div[aria-label="currency-group"] a')).map(item => ({currency: item.querySelector("h5").innerText, name: item.querySelector("p").innerText, flag: window.getComputedStyle(item.querySelector(".currency-flag")).getPropertyValue('background-image').slice(4, -1).replace(/"/g, "")})).filter(item => Intl.supportedValuesOf('currency').includes(item.currency))