table2csv Bookmarklet

Converts all tables content in a page to CSV. It will open a new window with CSV for each found table.

Source (pdvel.com)


Download Bookmarklet:


View Bookmarklet Code:

Bookmarklet Source Code:

javascript%3Avoid%28%21function%28%29%7BArray.prototype.slice.apply%28document.querySelectorAll%28%22table%22%29%2Cnull%29.forEach%28function%28e%2Cr%29%7Bvar%20l%2Ct%3D%22%22%2Co%3De.querySelector%28%22thead%22%29%3Bl%3Do%3Fo.querySelectorAll%28%22th%22%29%3Ae.querySelectorAll%28%22th%22%29%3Bvar%20n%3D%5B%5D%3Bl.length%3E0%26%26%28Array.prototype.slice.apply%28l%2Cnull%29.forEach%28function%28e%29%7Bn.push%28%27%22%27+e.textContent.replace%28/%5Cn/gi%2C%22%22%29.replace%28/%5Cs%5Cs+/gi%2C%22%20%22%29.trim%28%29.replace%28/%5C%22/gi%2C%27%22%27%29+%27%22%27%29%7D%29%2Ct+%3Dn.join%28%22%2C%22%29%2Ct+%3D%22%5Cn%22%29%3Bvar%20c%3D%211%3BArray.prototype.slice.apply%28e.querySelectorAll%28%22tr%22%29%2Cnull%29.forEach%28function%28e%29%7Bif%28e%29%7Bc%3D%211%2Cn%3D%5B%5D%3Bvar%20r%3De.querySelectorAll%28%22td%22%29%3BArray.prototype.slice.apply%28r%2Cnull%29.forEach%28function%28e%2Cr%29%7Bc%3D%210%2Cn.push%28%27%22%27+e.textContent.replace%28/%5Cn/gi%2C%22%22%29.replace%28/%5Cs%5Cs+/gi%2C%22%20%22%29.trim%28%29.replace%28/%5C%22/gi%2C%27%22%27%29+%27%22%27%29%7D%29%2Cc%26%26%28t+%3Dn.join%28%22%2C%22%29+%22%5Cn%22%29%7D%7D%29%3Bvar%20p%3Dwindow.open%28%22table_%22+r%29%3Bp%26%26%28p.document.open%28%29%2Cp.document.write%28%22%3Cpre%3E%22+t+%22%3C/pre%3E%22%29%2Cp.document.close%28%29%29%7D%29%7D%28%29%29


Rate it:


Tags:

Comments

Comments so far. Add yours.