tampermonkey油猴使用实现对亚马逊店铺的自动翻页功能

可以查找如https://www.amazon.com/s?k=curtain&page=1

// ==UserScript==
// @name         amazon
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.amazon.com/*
// @grant        none
// @require https://code.jquery.com/jquery-2.1.4.min.js
// ==/UserScript==


(function() {
    'use strict';
    // Your code here...
    // 触发请求
   if ($(".a-last [href]").attr("href")){
    var amazonurl='https://www.amazon.com'+$(".a-last [href]").attr("href");
   console.log(amazonurl);
   window.setTimeout(function(){ location.href = amazonurl; },3000);
   }
    else {console.log("最后一页了");}

})();

有问题可以和博主交流

猜你喜欢

转载自blog.csdn.net/weixin_45631815/article/details/115016635