Jump to content
UBot Underground

Clicking on multiple chosen buttons?


Recommended Posts

Hi,

I love UBot yet am still struggling to learn it.

As an exercise I'm building a simple twitter friend adder bot. I managed to get through the input, login, keyword search parts but I can't figure out, one I'm on a friend search results page, how do I loop over all "follow this x" buttons on the page?

 

I can choose them by attribute, but "click chosen" only clicks the first one.

Twitter is using some jQuery to do the ajax friend adding but I think it shouldn't be an issue.

The attribute I choose from is a outer html, looking for a wildcard on:

<BUTTON class=btn title="" type=submit value="Actions" href="/friendships/create/"*

 

I basically want to loop through the people on the page and hit "follow" for each one.

 

Any advice on how to do that?

Link to post
Share on other sites

gilad, still wet behind the ears myself and very new to Ubot but did you try or is it possible to scrape the links you need to click to a list and then process the list clicking on them as it goes through the list? I could be completely wrong as I am not a programmer (nightmares from doing Java classes at uni many years ago). If that won't work, is it possible to use some kind of "while" statement?

Link to post
Share on other sites

gilad, still wet behind the ears myself and very new to Ubot but did you try or is it possible to scrape the links you need to click to a list and then process the list clicking on them as it goes through the list? I could be completely wrong as I am not a programmer (nightmares from doing Java classes at uni many years ago). If that won't work, is it possible to use some kind of "while" statement?

This is pretty much the correct way, yes. :)

Link to post
Share on other sites

Hi and thanks for the replies.

That won't work in this case as the "follow" button all have the same href and use Jquery to somehow AJAX submit the follow command.

That means I must find someway to loop on all buttons on the screen and "click" them.

 

Any suggestion?

Link to post
Share on other sites

I have already made this bot, and it works great. you can view all the code in it to see how to do what you are trying to do. I hope it helps.

 

John

Link to post
Share on other sites

Your a life saver John, Thanks!

I've studied the code and I see what I was missing (the /* part). Thank you so much for sharing!

Link to post
Share on other sites
  • 7 years later...

Hey Lorenz123

 

You will likely get a faster response if you create your on Thread with what you need help with.

 

This is a very old thread and the code for it is likely based on version 2 of UBot and not the current version 5 that we are all using.

 

Thanks

 

Buddy

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...