Created
January 17, 2018 08:04
-
-
Save mpneuried/8976d598e7d2523942100758afcbb16d to your computer and use it in GitHub Desktop.
Filter Refurb Macs by GB and SSD: Small function to remove all refurbished macs that does not match the defined GB and SSD size
This file contains 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
// 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