parentコード スニペットではparentNode.
とにかく、一般的に、動的要素の場合は、ターゲット要素を確認して待つ必要があります。何かをクリックする必要がある場合は、スクリプトでクリックする必要があります。(通常、Google サイトでページ JS 機能を使用しようとしてもうまくいきません。Google ページは常に、スクリプトを作成するのに非常に「楽しい」ものです。;))
AJAX の遅延を補うために、ポーリングを多用する必要があります。(AJAX イベントへのフックまたはミューテーション イベントの使用はどちらも、成功に対する苦痛の比率が高くなります。ポーリングはうまく機能します。)
最後に、これは Google であるため、投票を 1 回実行するだけでは十分ではありません。これらの検索オプションは常に上書きされているからです。
これは、米国版の Google 検索結果で機能するサンプル スクリプトです (jQuery が必要です)。
// ==UserScript==
// @name        _Google Search options add
// @include     http://www.google.com/*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
// ==/UserScript==
if (window.top != window.self)  //-- Don't run on frames or iframes.
    return;
/*-- This script:
    1) Waits for the "More search tools" control.
    2) Clicks that control.
    3) Waits for the target element
    4) Adds our element before that one.
*/
waitForKeyElements ("#tbpi", clickMoreSearchToolsLink);
function clickMoreSearchToolsLink (jNode) {
    var clickEvent  = document.createEvent ('MouseEvents');
    clickEvent.initEvent ('click', true, true);
    jNode[0].dispatchEvent (clickEvent);
    waitForKeyElements ("#qdr_y", addOurExtraNodes);
}
function addOurExtraNodes (jNode) {
    jNode.before ("<li>Look at me, Ma!</li>");
}
/*--- waitForKeyElements():  A handy, utility function that
    does what it says.
*/
function waitForKeyElements (
    selectorTxt,    /* Required: The jQuery selector string that
                        specifies the desired element(s).
                    */
    actionFunction, /* Required: The code to run when elements are
                        found. It is passed a jNode to the matched
                        element.
                    */
    bWaitOnce,      /* Optional: If false, will continue to scan for
                        new elements even after the first match is
                        found.
                    */
    iframeSelector  /* Optional: If set, identifies the iframe to
                        search.
                    */
) {
    var targetNodes, btargetsFound;
    if (typeof iframeSelector == "undefined")
        targetNodes     = $(selectorTxt);
    else
        targetNodes     = $(iframeSelector).contents ()
                                           .find (selectorTxt);
    if (targetNodes  &&  targetNodes.length > 0) {
        /*--- Found target node(s).  Go through each and act if they
            are new.
        */
        targetNodes.each ( function () {
            var jThis        = $(this);
            var alreadyFound = jThis.data ('alreadyFound')  ||  false;
            if (!alreadyFound) {
                //--- Call the payload function.
                actionFunction (jThis);
                jThis.data ('alreadyFound', true);
            }
        } );
        btargetsFound   = true;
    }
    else {
        btargetsFound   = false;
    }
    //--- Get the timer-control variable for this selector.
    var controlObj      = waitForKeyElements.controlObj  ||  {};
    var controlKey      = selectorTxt.replace (/[^\w]/g, "_");
    var timeControl     = controlObj [controlKey];
    //--- Now set or clear the timer as appropriate.
    if (btargetsFound  &&  bWaitOnce  &&  timeControl) {
        //--- The only condition where we need to clear the timer.
        clearInterval (timeControl);
        delete controlObj [controlKey]
    }
    else {
        //--- Set a timer, if needed.
        if ( ! timeControl) {
            timeControl = setInterval ( function () {
                    waitForKeyElements (    selectorTxt,
                                            actionFunction,
                                            bWaitOnce,
                                            iframeSelector
                                        );
                },
                200
            );
            controlObj [controlKey] = timeControl;
        }
    }
    waitForKeyElements.controlObj   = controlObj;
}