Last active
December 12, 2022 04:45
-
-
Save multimeric/a4fd75ee46ba563ed45f05defcfa9483 to your computer and use it in GitHub Desktop.
Script to create a CSV out of the Cart Review Page of TCGPlayer
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
(function(){ | |
let str = '' | |
let tables = Array.from($('.sellerWrapMarket')) | |
for (let table of tables){ | |
let $table = $(table) | |
let rows = Array.from($table.find('table.sellerTable')) | |
for (let row of rows){ | |
let $row = $(row) | |
// Card name | |
str += $row.find('.itemsContents h3').text() + '\t' | |
// Card condition | |
str += $($row.find('.detailsContents p').get(1)).text().trim().replace('\n', '') + '\t' | |
// Card set | |
str += $row.find('.itemsContents p').text() + '\t' | |
// Price | |
str += $row.find('.priceBox').text().trim() + '\t' | |
// Quantity | |
str += $row.find('.qtyBox').text().trim() + '\n' | |
} | |
} | |
console.log(str) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment