Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function html2json() {
  2. // Remove the "NEW" labels because they cause formatting issues.
  3. $('.label').remove();
  4.  
  5. var result = [];
  6. $('table tr').each(function(i) {
  7. // Skip the table header
  8. if (i === 0) return;
  9. var row = [];
  10. $(this).children().each(function(j) {
  11. // Skip the SHORTLIST | APPLY column
  12. if (j === 0) return;
  13. row.push($(this).text().trim());
  14. });
  15. result.push(row);
  16. });
  17.  
  18. console.log(JSON.stringify(result));
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement