Skip to content

Instantly share code, notes, and snippets.

@davidshumway
Last active March 8, 2018 12:53
Show Gist options
  • Save davidshumway/d2f983facd076e4e2c3a6e3cdf87237f to your computer and use it in GitHub Desktop.
Save davidshumway/d2f983facd076e4e2c3a6e3cdf87237f to your computer and use it in GitHub Desktop.
EBay.com Purchase History To CSV. Outputs a CSV formatted string in the browser console containing all items on the page, including the title, price, and date purchased. This is especially useful for tax purposes. That is, it may be useful for anyone creating a list of the items on their eBay purchase history for tax purposes, in order to avoid …
var x = document.getElementsByClassName('vip item-title');
var y = document.getElementsByClassName('cost-label');
var z=document.getElementsByClassName('purchase-header row-header');
var stro=[];
for (var i=0;i<x.length;i++) {
stro.push(
'"'+x[i].innerText+'","'+
z[i].innerText.replace(/ORDER DATE[\r\n\t\s]+/, '')+'",'+
y[i*2].innerText.replace(/^US \$/, '')
);
}
console.log(stro.join('\n'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment