Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.clear();
- let headers = ['amount', 'name', 'link'];
- let tags = document.getElementsByClassName('clouds_xsmall');
- let data = [];
- for (let item of tags) {
- let link = item.firstChild;
- let href = link.href;
- let title = link.title;
- let amount = parseInt(title.match(/\d+/)[0]);
- let text = link.innerHTML;
- data.push({
- amount,
- name: text,
- link: href,
- });
- }
- data.sort((a, b) => {
- return b.amount - a.amount;
- })
- console.table(data, headers)
Advertisement
Add Comment
Please, Sign In to add comment