從螢火的XPath按鈕如下:
.//*[@id='ctl00_mainContentPlaceholder_Button3']
和腳本的段子:
<br>
<input name="ctl00$mainContentPlaceholder$Button3"
value="Back To Auctions"
onclick="closePopup(); return false;"
id="ctl00_mainContentPlaceholder_Button3"
class="simplemodal-close"
style="width:160px;"
type="submit">
<br>
我的GM腳本如下如下:
// @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();
我發現了這個拍賣網站,我想用通用汽車實現自動化。有兩個屏幕截圖。 www.mediafire.com/?lwy7agybtfn2x。第一個屏幕截圖是網站的基本概述,帶有出價按鈕。第二個概述,獎金彈出。
我需要做的是:首先需要一些幫助來擺脫彈出窗口。如果它在那裏我不能出價。我爲登錄頁面使用了一個類似的腳本,並設法讓GM自動登錄,因爲服務器需要您每三個小時左右登錄一次。參見上面提到的腳本和xpath。我試過了,但是我的gm腳本文件沒有點擊它。
然後項目:我想自己做一些,但我需要一些指針。上附加的txt文件,auction1.txt,我已經複製了一些Firebug的控制檯文件,這看起來像:
GET http://www.xxx.xxx/REST_Service/REST_Auction.svc/GetAuctionData?_=1303059143094
200 OK
29.62s firebu...rver.js (line 169)
<System>
ParamsHeadersResponse {"d":[["","","y","ZAR","1","33713","8887, 8887, 8887, 8887, 8887",null,"1.26","8887","0:13:30","","12","","C","29",null],["","","y","ZAR","2","34029","",null,"0.76","NONE","0:10:37","","5","","L",null,null],["","","y","ZAR","3","30332","3616, 9390, 9841, 8664, 4901",null,"379.80","3616","0:01:09","","1100","","T",null,null],["","","y","ZAR","4","33987","3616, 9168, 0605, 9168, 8771",null,"1.26","3616","0:00:51","","12","","T",null,null],["","","y","ZAR","5","34030","",null,"0.76","NONE","0:12:28","","5","","L",null,null],["y","-00:00","y","ZAR","6","34028","1137, 1137, 1137, 1137",null,"2.64","1137","0:20:05","","12","","L","12","vkSaGLYmZD+vgphl90foiM+3QXDf0c7SRfpMnt9PSDw="],["","","y","ZAR","7","33938","3616, 3616",null,"5.60","3616","0:01:50","","55","","T",null,null],["","","y","ZAR","8","33729","3616, 6197, 3616, 6197, 9134",null,"3.34","3616","0:01:26","","29","","T",null,null],["","","y","ZAR","9","33867","1551, 7243",null,"1.73","1551","0:02:40","","10","","B",null,null],["","","y","ZAR","10","33293","1551, 7243, 7243, 7243, 7243",null,"3.43","1551","0:06:10","","10","","B",null,null],["","","y","ZAR","11","33174","7243, 4901, 3614, 0481, 0481",null,"3.71","7243","0:06:10","","10","","B",null,null]]}
GET http://www.xxx.xxx/REST_Service/REST_Auction.svc/GetAuctionData?_=1303059144766
從那裏我可以看到我需要的所有信息,並更新每一秒,所以爲了讓我告訴GM腳本在哪個按鈕上出價,我需要將這些信息放入要處理的腳本中。有沒有人有任何想法?
我在爲12個小型拍賣的每一個寫一個小腳本,每個處理自己的部分,收集自己的信息。我認爲這些來自Firebug的反應可能是有用的,也是更直接的獲取信息的方式,即從窗口中逐一減去它們,然後再進行更新。
看起來你有'ctl00 $ mainContentPlaceholder $ Button3'而不是'ctl00_mainContentPlaceholder_Button3' ... – 2011-04-17 20:57:13
@ alenjandro:頁面中的腳本是:「
「 – Ludwig 2011-04-18 03:01:53
但我的GM腳本我爲甲肝:」 VAR joinBtn = document.evaluate( '// * [@ id中, 「ctl00_mainContentPlaceholder_Button3」]', 文件, 空, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, 空).singleNodeValue.click();」它是ctl00_mainContentPlaceholder_Button3,所以我不知道如果我是正確的... – Ludwig 2011-04-18 03:05:09