SOURCE

function getByClass1(parent, cls) {
  var res = [];
  var ele = parent.getElementsByTagName('*');
  for (var i = 0; i < ele.length; i++) {
    if (ele[i].className == cls) {
      res.push(ele[i]);
    }
  }
  return res;
};

if (window.location.href.indexOf('baidu') > 0) {
  window.location.href = 'https://auth.alipay.com/login/index.htm';
}

if (window.location.href.indexOf('login/index.htm') > 0) {
  document.getElementById('J-loginMethod-tabs').childNodes[3].click();
  document.getElementById('J-input-user').value = '1393997412@qq.com';
  //document.getElementById('password_rsainput').value = 'lins******006';
  document.getElementById('password_rsainput').focus();
  //document.getElementById('J-login-btn').click();
  window.location.href = getByClass1(document, 'more')[0].href
}
if (window.location.href.indexOf('portal/i.htm') > 0 == true) {
  window.location.href = 'https://consumeprod.alipay.com/record/standard.htm';
}
if (window.location.href.indexOf('record/standard.htm') > 0) {

  setTimeout(function() {
    window.location.reload();
  },
  5000);
  setTimeout(function() {
    list = [];   
    $('.table-index-bill .J-item').each(function(index, item) {
      obj = new Object();
      obj.paytime = $(item).children('.time').find('.text-muted').html().trim().replace(':', '');
      obj.name = $(item).children('.name').find('.name').html().trim();
      obj.status = $(item).children('.status').find('.text-muted').html().trim();
      strtmp = $($(item).children('.operation').find('.btn-group-item')[0]).attr('data-link') + '';
      if (strtmp.indexOf('tradeNo=') > 0) {
        obj.tradeNo = strtmp.substr(strtmp.indexOf('tradeNo=') + 'tradeNo='.length);
      } else if (strtmp.indexOf('bizInNo=') > 0) {
        start = strtmp.indexOf('bizInNo=') + 'bizInNo='.length;
        end = strtmp.indexOf('&');
        obj.tradeNo = strtmp.substr(start, end - start);
      }
      obj.amount = $(item).children('.amount').find('.amount-pay').html().trim().replace(' ', '');
      list[index] = obj
    });
    var data = JSON.stringify(list);

    $.ajax({
      type: 'get',
      async: false,
      url: 'http://127.0.0.1/nverguo/updatePayInfo.jhtml',
      //实际上访问时产生的地址为: ajax.ashx?callbackfun=jsonpCallback&id=10
      data: {
        info: data
      },
      cache: false,
      dataType: 'jsonp',
      jsonp: 'callbackfun',
      jsonpCallback: 'returnvalzhifubao',
      success: function(json) {
        console.log('success' + json);
      },
      error: function(json) {
        console.log('error' + json);
      }
    });
  },
  3000);

}
console 命令行工具 X clear

                    
>
console