Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Filter Refurb Macs by GB and SSD: Small function to remove all refurbished macs that does not match the defined GB and SSD size
// paste and execute it into the browser console. You can define ( GB, SSD [, index-of-box-content-class ] )
// https://www.apple.com/de/shop/browse/home/specialdeals/mac/macbook_pro
// eventually there is a header then you can test the param index-of-box-content-class = 1
((_gb, _ssd, content_idx) => { const _wrp = document.getElementsByClassName("box-content")[ content_idx || 0];Array.from(document.getElementsByClassName("specs")).forEach((el) =>{if (!(el.innerHTML.indexOf(_gb.toString() + " GB") > 0 && el.innerHTML.indexOf(_ssd.toString() + " GB") > 0)) {_wrp.removeChild(el.parentNode.parentNode.parentNode)}})})(16,512)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment