我必须点击“Ik neem er een!”与Greasemonkey联系。
链接(位于http://www.ibood.com/nl/nl):
<div class="box_order_btn">
<a class="btn_order nl" href="https://order.ibood.com/nl/nl/order/?id=33869&h=e82f93d244de247a3b73477381eb8a40" title="Ik neem er een!">Ik neem er een!</a>
<span class="sold_out">Uitverkocht!</span>
</div>
我试过Greasemonkey脚本:
// ==UserScript==
// @name Click the link
// @include https://*.ibood.com/*
// @version 1.0
// @history 1.0 Initial release
// ==/UserScript==
var TargetLink = $("a:contains('Ik neem er een!')")
if (TargetLink && TargetLink.length)
window.location.href = TargetLink[0].href
答案 0 :(得分:1)
该脚本使用jQuery($(...)
位是强指示符),但在元数据部分中没有@require
jQuery。
使用:
// ==UserScript==
// @name Ibood, click the link
// @include https://*.ibood.com/*
// @include http://*.ibood.com/*
// @version 1.0
// @history 1.0 Initial release
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @grant GM_addStyle
// ==/UserScript==
/*- The @grant directive is needed to work around a design change
introduced in GM 1.0. It restores the sandbox.
*/
var TargetLink = $("a:contains('Ik neem er een!')")
if (TargetLink.length)
window.location.assign (TargetLink[0].href);