I need to save some data from a html table (an external site) to a json file to work with the data.
Is there a way to access a table from an external HTML site (not like in my code example)?
Is there a way to create a json file from the data (I need the columns in an array or object?) and save it somehow so I can work with it?
The current output of data i hardcoded into my site is: (I need to access from an external site)
https://i.gyazo.com/8bea34c222d8bba99c8705c8ca73c1a3.png
<table>
<tr>
<th>A1</th>
<th>A2</th>
<th>A3</th>
<th>A4</th>
<th>A5</th>
</tr>
<tr>
<td>B1</td>
<td>B2</td>
<td>B3</td>
<td>B4</td>
<td>B5</td>
</tr>
<tr>
<td>C1</td>
<td>C2</td>
<td>C3</td>
<td>C4</td>
<td>C5</td>
</tr>
<tr>
<td>D1</td>
<td>D2</td>
<td>D3</td>
<td>D4</td>
<td>D5</td>
</tr>
<tr>
<td>E1</td>
<td>E2</td>
<td>E3</td>
<td></td>
<td>E5</td>
</tr>
<tr>
<td>F1</td>
<td></td>
<td>F3</td>
<td></td>
<td></td>
</tr>
</table>
<script>
var columns = $('tr').first().children().map(function(i){
return [
$('tr').map(function(){
return $(this).children().eq(i).text()
}).get()
]
}).get();
localStorage
console.log(columns)