SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member arclite86's Avatar
    Join Date
    Nov 2013
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need to click a button

    I need to click this button:

    Code:
    <div tabindex="0" class="x-button-litebutton-wrapper x-btn action_button inline_block x-component x-btn-text-icon " id="x-auto-149" aria-describedby="x-auto-82" style="width: 40px;">Follow<img class=" x-btn-image" role="presentation" style='background: url("http://tweepi.com/js/tweepigxt/67791A54F68E6C387B9AEF4E96FFB252.cache.png") no-repeat -162px 0px; left: -1px; top: 3px; width: 16px; height: 16px; position: absolute;' onload='this.__gwtLastUnhandledEvent="load";' src="http://tweepi.com/js/tweepigxt/clear.cache.gif"
     border="0"></div>
    please help.

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,941
    Mentioned
    215 Post(s)
    Tagged
    12 Thread(s)
    Perhaps this:

    Code:
    document.getElementById("x-auto-149").click();

  3. #3
    SitePoint Member arclite86's Avatar
    Join Date
    Nov 2013
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it doesn't work
    by the way its a push in button
    could you show me all the options to push this button so i hope one of them will work

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,941
    Mentioned
    215 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    it does work
    Here's a demo.

    Maybe something else is at play?

  5. #5
    SitePoint Member arclite86's Avatar
    Join Date
    Nov 2013
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok well, i am working with greasemonkey, maybe you have heard of it, it allows you to customize a webpage without uploading anything
    so this is the script

    Code:
    // ==UserScript==
    // @name        tweepi
    // @namespace   tweepi
    // @description tweepi
    // @include     http://tweepi.com/tools/*
    // @version     1
    // @grant       none
    // ==/UserScript==
    {
    document.getElementById("x-auto-341").click();
    }
    maybe im doing somethin wrong here?

  6. #6
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,941
    Mentioned
    215 Post(s)
    Tagged
    12 Thread(s)
    I wouldn't have thought the curly braces are necessary:

    Code:
    // ==UserScript==
    // @name        tweepi
    // @namespace   tweepi
    // @description tweepi
    // @include     http://tweepi.com/tools/*
    // @version     1
    // @grant       none
    // ==/UserScript==
    
    document.getElementById("x-auto-341").click();
    Other than that, what is the url of the page containing the button you wish to click?

  7. #7
    SitePoint Member arclite86's Avatar
    Join Date
    Nov 2013
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the website is tweepi and this is the url button
    Code:
    http://tweepi.com/js/tweepigxt/67791A54F68E6C387B9AEF4E96FFB252.cache.png
    of this code:

    Code:
    <div tabindex="0" class="x-button-litebutton-wrapper x-btn action_button inline_block x-component x-btn-text-icon " id="x-auto-159" aria-describedby="x-auto-107" style="width: 40px;">Follow<img class=" x-btn-image" role="presentation" style='background: url("http://tweepi.com/js/tweepigxt/67791A54F68E6C387B9AEF4E96FFB252.cache.png") no-repeat -162px 0px; left: -1px; top: 3px; width: 16px; height: 16px; position: absolute;' onload='this.__gwtLastUnhandledEvent="load";' src="http://tweepi.com/js/tweepigxt/clear.cache.gif" border="0"></div>
    but i need to click about 20 buttons at the same time so the url can chance,

    but i have some other scripts that claim but somehow they dont work

    Code:
    // ==UserScript==
    // @name           twitter automatic follow back uses tweepi reciprocate
    // @namespace      mdlamar
    // @description    automates tweepi reciprocation
    // @include        http://tweepi.com/tools/recip/*
    // ==/UserScript==
    
    function getElementsByClassName(classname, node)  {
        if(!node) node = document.getElementsByTagName("body")[0];
        var a = [];
        var re = new RegExp('\\b' + classname + '\\b');
        var els = node.getElementsByTagName("*");
        for(var i=0,j=els.length; i<j; i++)
            if(re.test(els[i].className))a.push(els[i]);
        return a;
    }
    var node = document.getElementById('followtable');
    var checkboxes = getElementsByClassName('cbf', node);
    for(var i=0,j=checkboxes.length;i<j;i++){
      checkboxes[i].checked = true;
    }
    // This function inserts newNode after referenceNode
    function insertAfter( referenceNode, newNode )
    {
        referenceNode.parentNode.insertBefore( newNode, referenceNode.nextSibling );
    }
    setTimeout("document.getElementById('followbtn-bottom').click()",5000);
    var query = window.location.search.substring(1);
    query=query.split('&');
    for(i in query){
    	var tmp=query[i].split('=');
    	if(tmp[0]=='page'){
    		var page=Number(tmp[1]);
    		page++;
    		query[i]='page=' + page;
    	}
    }
    query = '?'+query.join('&');
    var link = document.createElement('a');
    var par = document.createElement('p');
    par.setAttribute('style', 'text-align:center');
    link.setAttribute('href', query);
    //link.setAttribute('id', 'nextpagelink');
    
    var text = document.createElement('input');
    text.setAttribute('value', 'Next page >');
    text.setAttribute('type', 'button');
    text.setAttribute('id', 'nextpagelink');
    link.appendChild(text);
    par.appendChild(link)
    document.getElementById('site').insertBefore(par,document.getElementById('main'));
    //setTimeout("document.getElementById('nextpagelink').click()",10000);
    I am trying to click these buttons for months PLEASE help me.

  8. #8
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,941
    Mentioned
    215 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    One thing at a time

    You are trying to use a GreaseMonkey script to simulate a button click.

    What is the address of the page on which I can find this button?

  9. #9
    SitePoint Member arclite86's Avatar
    Join Date
    Nov 2013
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can find this button on http://tweepi.com/tools/* on http://tweepi.com/ you simple need to create a account ( 2 min work) than you can acces the page
    I recently heard of others that its not a button but an image in a div...

  10. #10
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,941
    Mentioned
    215 Post(s)
    Tagged
    12 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •