Skip to content

Instantly share code, notes, and snippets.

@githubnando
Last active September 8, 2020 18:01
Show Gist options
  • Save githubnando/bac8a86901bf441d456488508bf759d8 to your computer and use it in GitHub Desktop.
Save githubnando/bac8a86901bf441d456488508bf759d8 to your computer and use it in GitHub Desktop.
All Black Panther Comic Books for Free

To get all 256 issues in a few minutes:

  1. Go here: US or EU
  2. Right click (anywhere) > Inspect Element > Console
  3. Paste (sometimes you need to refresh the page and paste again, but will be quicker the second time):
    var buttons = document.getElementsByClassName('action-button buy-action primary-action');
    
    function sleep(delay) {
        var start = new Date().getTime();
        while (new Date().getTime() < start + delay);
    }
    
    for (var i = 0; i < buttons.length; i++) {
        if (buttons[i].firstElementChild.firstElementChild.textContent === "In Cart") {
            continue
        };
    
        buttons[i].click();
        sleep(600);
    }

Wait a few seconds until you see "In Cart". Repeat for the next page or refresh the page and paste again if it didn't add everything.

Any JS developer out there, feel free to enhance this script!

@githubnando
Copy link
Author

The website has a limit of 150... So after the 4th page you will need to checkout to be able to continue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment