需要单击带有油脂猴子脚本的出价按钮 [英] Need to click a bid button with Grease monkey script

查看:58
本文介绍了需要单击带有油脂猴子脚本的出价按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点卡住了.我正在尝试创建一个Grease Monkey脚本,该脚本将自动单击出现在拍卖网站上的弹出窗口.我有Xpat,但是我对GM的经验太深,无法使其正常工作.

I'm a bit stuck. I'm trying to create an Grease Monkey script that will automatically click an pop-up that appears on an auction site. I'v got the Xpat, but i'm too in expierienced with GM to get it to work.

这是我从探火仪得到的萤火虫元素检查线:

Here is theelement inspection line i get from fire finder for firebug:

<input type="submit" style="width: 160px;" class="simplemodal-close" id="ctl00_mainContentPlaceholder_Button3" onclick="closePopup(); return false;" value="Back To Auctions" name="ctl00$mainContentPlaceholder$Button3">

和firpath,xpath行是:

and the firpath, xpath line is:

.//*[@id='ctl00_mainContentPlaceholder_Button3']

完整路径的xpather行:

xpather line for full xpath:

/html/body/form[@id='aspnetForm']/div[@id='simplemodal-container']/div/div[@id='basic-modal-content']/div[@id='modal_winningBanner']/div/div[2]/div[2]/input[@id='ctl00_mainContentPlaceholder_Button3']

所以我在我的gm脚本中尝试使它单击按钮的方法如下:

So what i used in my gm script to try to get it to click the button is as follows:

// @include *
// @version 0.1
// @description Automatically click // ==/UserScript==

click_popupBtn1 = function() {

var joinBtn=document.evaluate('//*[@id, "ctl00_mainContentPlaceholder_Button3"]'
    ,document,
      null,
     XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
     null).singleNodeValue.click();
  alert(joinBtn);
       if(!joinBtn) return false;
          joinBtn.click();
      return true;
}


click_popupBtn1 ();

我认为香港专业教育学院的语法有问题,但不知道如何调试GM.几年前,我只使用turbo pascal,但是想用Java和GM完成一些简单的事情.

I think ive got something wrong on the syntax, but dont know how to debug GM. I've only worked with turbo pascal a few years ago, but would like to get some simple things done in java and GM.

任何帮助将不胜感激.

谢谢 路德维希

推荐答案

嗯,我听不懂您使用的许多单词或这种复杂的语法.

umm, I don't understand a lot of the words you used or this complex syntax.

但类似:

document.getElementById("ctl00_mainContentPlaceholder_Button3").click();

应该工作.

这篇关于需要单击带有油脂猴子脚本的出价按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆