Created
July 24, 2020 18:02
-
-
Save ivanlawrence/5edd8a5fc49c10f7a7f6573f9607b4a1 to your computer and use it in GitHub Desktop.
Magic Formula Investing - download - bookmarklet
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
| javascript:(function(){ | |
| let csv = [] | |
| // loop through each row | |
| $('#tableform').find('tr').each(function() { | |
| let row = []; | |
| // loop through each cell in a row | |
| $(this).find('th,td').each(function() { | |
| // add to the row array | |
| row.push( '"' + $(this).text().trim() + '"' ); | |
| }); | |
| // add a row to the CSV | |
| csv.push( row.join(',') ); | |
| }); | |
| // flatten the CSV | |
| let csvText = csv.join('\r\n') | |
| let dl = document.createElement("a"); | |
| dl.href = "data:text/csv;charset=utf-8,"+ encodeURI( csvText ); | |
| dl.download = "magicFormulaInvesting.csv"; | |
| document.body.appendChild(dl); | |
| dl.click(); | |
| document.body.removeChild(dl); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment