Jump to content
UBot Underground

How To ? Only Click If Id Does Not Match Multiple Items (Element Offset)


Recommended Posts

Hi all,

 

Question , I am trying to click a button using offsets. So lets say there is a delete button and they are all 100% the same so I am using element offset.

 

- I have scraped how many buttons are on the page

- I have a list of ids that are not allowed to match the offset

 

-->Example

--> Let's say there are 20 buttons (this always varies)

--> My List with ID contains 0,5,8,12,18 (this also varies so a hardcoded else if will be getting quite long)

 

How do I click on all DELETE buttons except (0,5,8,12,18) ?

 

I know I could do as many else if as i have IDs in my list , but that list could literally be one item or all 20... SO as you see working with hard coded else if is not really that great of a solution here

 

Thanks,

Link to post
Share on other sites

Hi,

 

Try something like this...

set(#offset index,0,"Global")
loop(20) {
    if($comparison(#offset index,"!= Does not equal",$find regular expression(#offset index,"0|5|8|12|18"))) {
        then {
            alert("{#offset index} I can click it!")
            comment("click here and put #var in offset")
        }
    }
    increment(#offset index)
}

count the elements to put in the loop cycles

 

Regards,

Nick

Link to post
Share on other sites

Ok just needed that input. Solved

 

Given the regex all I needed to do is loop through by list total (my ids), then just add each id to the variable with "|" and thats all :

 

Thanks !

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...