$(function() { setTimeout(function() { var href_prof = $('a[data-reactid=".0.1.1.0.0.1.0.0.0"]').attr('href'); if (href_prof != "") { $.get(href_prof, '', function (data, textStatus, XMLHttpRequest){ if (textStatus == "error") { return; } else { $(data).find('div.panel-body > script:contains("formElements")').each(function() { let str = ""; str = $(this).html(); const matchX = str.match(/let formElements(.*) = (.*);/); let dop_poles = matchX[2]; let dop_polesJSON = JSON.parse(dop_poles); const matchY = str.match(/let values(.*) = (.*);/); let dop_pole_values = matchY[2]; let dop_pole_valuesJSON = JSON.parse(dop_pole_values); for (var key in dop_polesJSON.fields) { let id = dop_polesJSON.fields[key].id; dop_polesJSON.fields[key].value = dop_pole_valuesJSON[id]; if (dop_polesJSON.fields[key].label == 'sb_id'){ $('.user-phone').after('
sb_id: '+dop_polesJSON.fields[key].value+'
'); } } /* console.log(dop_polesJSON);*/ }); } }); } }, 1000); });