您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Takes a TCGPlayer Cart/History and spits out a CSV
当前为
// ==UserScript== // @name TCGPlayer Cart/History to CSV in Console // @namespace http://tampermonkey.net/ // @version 0.2 // @description Takes a TCGPlayer Cart/History and spits out a CSV // @author multimeric, ganondorc, micool777 // @match https://cart.tcgplayer.com/* // @match https://store.tcgplayer.com/myaccount/orderhistory // @match https://store.tcgplayer.com/shoppingcart/review // @icon https://www.google.com/s2/favicons?sz=64&domain=tcgplayer.com // @grant none // @require http://code.jquery.com/jquery-3.4.1.min.js // @license MIT // ==/UserScript== window.addEventListener('load', function() { function qs(element, query){ // Finds an element by selector and returns it as an array return Array.from(element.querySelectorAll(query)) } let csv = 'Name\tRarity\tCondition\tIndividual Price\tQuantity\n'; for (let order of qs(document, '.orderWrap')){ for (let tr of qs(order, '.orderTable tr')){ try{ let items = [ qs(tr, '.nocontext')[0].innerText, qs(tr, '.orderHistoryDetail')[0].childNodes[0].textContent.split(':')[1], qs(tr, '.orderHistoryDetail')[0].childNodes[2].textContent.split(':')[1], qs(tr, '.orderHistoryPrice')[0].innerText, qs(tr, '.orderHistoryQuantity')[0].innerText ]; csv += items.map(item => item.trim()).join('\t') + '\n'; } catch { continue; } } } console.log(csv); // window.alert(csv); (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().replace(/ *\([^)]*\) */g, "") + '",' // 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().replace(/\$/g, '') // Quantity // str += $row.find('.qtyBox').text().trim() + '\t' str += '\n' } } console.log(str); // window.alert(str); })() }, false);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址