额,不知道这样好不好。
 
只是还是希望CSDN不要删除啊,无论是好的坏的,咱们都要开源分享不是。
主要就是基于Chrome可以在Console中运行js来做的。
 
以京东夺宝岛为例子我们须要做例如以下的事情:
paimaiId=10473082&skuId=0&t=650541&start=0&end=9
剩下的就是開始写脚本了。
var t,count = 1,price=0,pin = getCookie(‘pin‘),f = function(){
    $.ajax({
    url:‘http://paimai.jd.com/json/current/englishquery?paimaiId=‘+paimaiId+‘&skuId=0&t=964468&start=0&end=9‘,
    async:false,
    success:function(data){
        var currentPrice = parseFloat(data.currentPrice);
        console.info("第",count,"次检測商品当前拍卖价格是",currentPrice);
        if(data.auctionStatus == 2){
            console.error("商品拍卖结束,获得者",data.currentUser);
            clearTimeout(t);return;
        }
        if(data.currentPrice < 1500) {
            if(pin != data.currentUser && price != currentPrice){
                $.ajax({
                url:‘http://paimai.jd.com/services/bid.action?t=369168&paimaiId=‘
+paimaiId+‘&proxyFlag=0&bidSource=0&price=‘+(currentPrice+1),
                async:false,
                success:function(data1){
                    console.warn("第",count,"次加价拍,本次出价",(currentPrice+1),"出价结果",data1.message);
                    if(data1.result == 200){
                        currentPrice = currentPrice+1;
                    } else {
                        if(data1.result == 516) {clearTimeout(t);return;}
                    }
                }
                });
            } else {
                console.info("商品价格未变。忽略加价");
            }
            price = currentPrice;
            t = setTimeout(f,1000);
        } else {
            console.error("商品价格高于原价5折。停止加价");
            clearTimeout(t);
        }
    }
    });
    count++;
}
f();
//暂停
clearTimeout(t)代码还是比較简单,就不多做解释了。这里说一下有个关键的地方是网页分析的部分。就是从请求中拿到了自己想要的数据。
这样例子的请求是一个json,所以可以直接用了,假设是一个html网页应该怎么办呢? 
由于如今的网页一般都用了jquery,所以可以使用jquery脚本来做。他的拾取器还是之棒的。
 
比方这样: 
var val = 
原文:http://www.cnblogs.com/mfmdaoyou/p/6724927.html