If you ever find yourself needing to export a table on a webpage you are viewing but they don't have a download or export to CSV button, use the following code to export the table to a CSV file.
-
Use a Table to CSV browser extension like the following one. If that is not possible then following the instructions below:
-
Open the browser's Developer Tools (F12 on Windows)
-
Run the following command in the Console tab of the Developer Tools:
var script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/npm/table2csv@1.1.5/dist/table2csv.min.js';
script.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(script);
$(document).ready(function () {
setTimeout(function() {
$('table').first().table2csv();
}, 200)
})