ページが読み込まれるまで待って、クイック返信ボタンを見つけてクリックし、テキストエリアを見つけて、その値を「バンプ」に変更し、クイック返信ボタンをクリックしますが、問題はgetElementsByAttribute関数にはありません。コピーしましたそれが機能した私の別のスクリプトから
window.onload=function(){
var t1=setTimeout(function(){getElementsByAttribute("src", "http://assets.bodybuilding.com/forum/bodybuilding/buttons/reply.gif")[0].click();},3000);
var t2=setTimeout(function(){getElementsByAttribute("class", "cke_source cke_enable_context_menu")[0].value = "bump";},3000);
var t3=setTimeout(function(){getElementsByAttribute("value", "Post Quick Reply")[0].click();},3000);
}
document.getElementsByAttribute = function( attrib, value, context_node, tag ) {
var nodes = [];
if ( context_node == null )
context_node = this;
if ( tag == null )
tag = '*';
var elems = context_node.getElementsByTagName(tag);
for ( var i = 0; i < elems.length; i += 1 ) {
if ( value ) {
if ( elems[i].hasAttribute(attrib) && elems[i].getAttribute(attrib) == value )
nodes.push(elems[i]);
} else {
if ( elems[i].hasAttribute(attrib) )
nodes.push(elems[i]);
}
}
return nodes;
}