js范例

 

// ==UserScript==
// @name          http://ehire.51job.com/Candidate/ResumeViewBeta.aspx
// @namespace     resume
// @description   show accesskeys defined on page
// @include       *ResumeViewBeta.aspx*
// ==/UserScript==

var interval = setInterval(resume, 1000);
function resume()
{
 var nums = "一二三四五六七八九十";
 var name = document.querySelector("#divResume table span b").innerHTML;

 var arr = document.querySelector("#divResume table table tr:nth-of-type(2) span b").innerHTML.split("|");
 var workYears = nums.indexOf(arr[0].substr(0, 1)) + 1;
 var sex = arr[1].substr(6, 1);
 var address = document.querySelector("#divResume table table tr:nth-of-type(2) tr:nth-of-type(2) td:nth-of-type(2)").innerHTML;
 var phone = document.querySelector("#divResume table table tr:nth-of-type(3) td:nth-of-type(2)").innerHTML;
 if(0== phone.indexOf("0"))
 {
  phone = phone.substr(1);
 }
 
 phone = parseInt(phone);
 if (!phone)
 {
  phone = document.querySelector("#divResume table table tr:nth-of-type(4) td:nth-of-type(2)").innerHTML;
   if(0== phone.indexOf("0"))
   {
    phone = phone.substr(1);
   }
   
   phone = parseInt(phone);
 }
 var company = document
   .querySelector("#divResume table table:nth-of-type(2) tr:nth-of-type(1) tr:nth-of-type(2) td:nth-of-type(2)").innerHTML;
 var workFunc = document
   .querySelector("#divResume table table:nth-of-type(2) tr:nth-of-type(1) tr:nth-of-type(4) td:nth-of-type(2)").innerHTML;
 var school = document
   .querySelector("#divResume table table:nth-of-type(2)  td:nth-of-type(3) tr:nth-of-type(4) td:nth-of-type(2)").innerHTML;
 var major = document
   .querySelector("#divResume table table:nth-of-type(2)  td:nth-of-type(3) tr:nth-of-type(2) td:nth-of-type(2)").innerHTML;
 
 var url = location.href;
 var param = url.substr(url.indexOf("?")+1);

 var id = param.split("&")[0].split("=")[1];

 if (name && workYears && sex && company && workFunc && school && major)
 {
  var info = [ name, phone, major,school,workYears,company, address,'', workFunc,id ];
  document.querySelector("#SubMenuHr").innerHTML = info.join("$");
  clearInterval(interval);
 }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值