Jump to content
UBot Underground

Recommended Posts

Hello ! I´ve been trying to make a system to ubot click on a comment text , so i set a ui box where the user would put the comment text and used this feature :

 

http://img811.imageshack.us/img811/1563/m0y6.png

 

But im getting "Invalid Parameter"

 

Am i doing it wrong ? What should i do ? Thanks (Im not an expert)

Edited by marcosolidbr
Link to post
Share on other sites

You get that popup because variable is not a valid "search query" when you use it like you did (the same goes for other similar commands/functions like "click","$exist",... ).

 

Instead you should provide variable inside "$element from text", and use this function in place where you use variable now.

Link to post
Share on other sites

You get that popup because variable is not a valid "search query" when you use it like you did (the same goes for other similar commands/functions like "click","$exist",... ).

 

Instead you should provide variable inside "$element from text", and use this function in place where you use variable now.

 

You mean this ?

http://img132.imageshack.us/img132/1539/8t5k.png

 

Now im getting the key provided wasant on dictionary 

 

Thanks 

 

(What im trying to do is make the ubot find the text on the page and click on it)

Link to post
Share on other sites

You didn't use that function as I told you. Variable "#textto" should be inside "$element from text" not inside "$search page"...

 

EDIT: I didn't notice that you are using "$search page" inside "click" command, which is wrong! Use this instead: "click>$element from text->#textto". FYI, "$search page" is used to check if element exists on the page, so it returns value in bool format (true, false).

 

You should also know that "click" command (consequentially also "$element from text") accepts input in format <tag="value">, so make sure "#textto" value looks similar, else you won't achieve desired result.

Link to post
Share on other sites

You didn't use that function as I told you. Variable "#textto" should be inside "$element from text" not inside "$search page"....

 

Thanks and sorry ! Do you have a tip for me , like i need the bot to click a button after finding the text (The button is on the comment and it id always change)

Edited by marcosolidbr
Link to post
Share on other sites

I've updated my previous post, but I guess you didn't read the latest version.

 

Thanks again , but here is the button code

 

<a class="UFILikeLink" href="#" role="button" data-ft="{"tn":">"}" title="Curtir este comentário" data-reactid=".r[2u3ml].[1][4][1]{comment457117361071506_2432737}.[0].{right}.[0].{left}.[0].[3].[2]">Curtir</a>

 

Any idea what would be the best solution to make ubot find that code ? And i dont know if the users would be able to find that code and insert on the ai .  Thanks (Sorry but im still a noob here )

 

EDIT :  I was thinking in getting the comment code which always change eg (comment457117361071506_2432737) but i dont know how to do this and  i dont know if the user would be able to find the code and insert on the ui . 

Edited by marcosolidbr
Link to post
Share on other sites

Well if you only have one button displayed on the page the answer is simple, you should use class from html you provided to find the element you are looking for....but I doubt that's the case. I guess the html you posted is from Facebook post page and there are multiple like buttons, so I should ask you first...which one you want for the bot to click?  The simplest way to tell that to UBot is to use "$element offset", while the harder one is to find html element (or a part of), and use that as element for click command.

Link to post
Share on other sites

Well if you only have one button displayed on the page the answer is simple, you should use class from html you provided to find the element you are looking for....but I doubt that's the case. I guess the html you posted is from Facebook post page and there are multiple like buttons, so I should ask you first...which one you want for the bot to click?  The simplest way to tell that to UBot is to use "$element offset", while the harder one is to find html element (or a part of), and use that as element for click command.

 

Well , The user would set which comment he want to like .

Edited by marcosolidbr
Link to post
Share on other sites

Ok, you picked the hard way....here is how you do it:

 

1. find a container where text from "ui text box is" and scrape it's content to variable

2. find a unique element that you wan't to click, inside the container/variable from step 1. (for your example you would extract "comment457117361071506_...." with regular expression) and save it to variable

3. click the element with "click->$element from text->#variable"

 

The click command would then look something like:

click($element from text("<data-reactid=w\"*{#variable}*\">"), "Left Click", "No")

  • Like 1
Link to post
Share on other sites

Thanks ! But i corrected some things because some of the code that you sent me  also change . So , now for some reason its saying that  "The expression you are trying to parse has extra data in it" . Here is the code :

click($element from text("<data-reactid={#variable}\}.[0].\{right\}.[0].\{left\}.[0].[3].[2]\">"), "Left Click", "No")

and this is the variable code ".r[wrn1].[1][4][1]\{comment456698364446739_2432947

 

Thanks

Edited by marcosolidbr
Link to post
Share on other sites

The reason you are getting that popup is that your "$element from text" content broken; the first thing is that after = char you should have double quote " char and additionally you should be escaping curly brackets. This is how it should look like:

click($element from text("<data-reactid=\"{#variable}\\\}.[0].\\\{right\\\}.[0].\\\{left\\\}.[0].[3].[2]\">"), "Left Click", "No")

...if you run this code it won't report an error, but #variable doesn't get recognized as UBot variable, so you might have problems with that (might be a bug).

 

Also, why wouldn't you just use my click code? You can use wild-chars to still find element without providing the full signature.

 

Here is how I got it working:

set(#variable, $find regular expression($scrape attribute(<title="Curtir este comentário">, "data-reactid"), "comment\\d+_\\d+"), "Global")
click($element from text("<data-reactid=w\"*{#variable}*\">"), "Left Click", "No")

Link to post
Share on other sites

 

The reason you are getting that popup is that your "$element from text" content broken; the first thing is that after = char you should have double quote " char and additionally you should be escaping curly brackets. This is how it should look like:

click($element from text("<data-reactid=\"{#variable}\\\}.[0].\\\{right\\\}.[0].\\\{left\\\}.[0].[3].[2]\">"), "Left Click", "No")

...if you run this code it won't report an error, but #variable doesn't get recognized as UBot variable, so you might have problems with that (might be a bug).

 

Also, why wouldn't you just use my click code? You can use wild-chars to still find element without providing the full signature.

 

Here is how I got it working:

set(#variable, $find regular expression($scrape attribute(<title="Curtir este comentário">, "data-reactid"), "comment\\d+_\\d+"), "Global")
click($element from text("<data-reactid=w\"*{#variable}*\">"), "Left Click", "No")

Just found out that the part in brackets after r. is always changing  .  Any idea on what can i do ?

 

EG : .r[wrn1]

Edited by marcosolidbr
Link to post
Share on other sites

I showed you an example which actually clicks the link (tested with HTML you provided, not on the actual page, so might not work there). All you need to do to get it working for your needs is to modify "$scrape attribute" to return the comment number that you want to click...once you do that, click command should click the right like button.

Link to post
Share on other sites

OK, I see we are getting nowhere, so might be easier to just provide you with solution. Bellow is a working script for clicking Facebook comment like buttons based on the comment text/string. To click specific comment like button save comment text to variable "#COMMENT Text" and that's it. Also notice that in case 2 comments with the same text exist code will click first 1.

 

Here is the code:

set(#COMMENT Text, "tambem quero", "Global")
set(#variable, $find regular expression($scrape attribute($element offset($element from text("<innertext=\"{#COMMENT Text}\">"), 0), "data-reactid"), "comment\\d+_\\d+"), "Global")
click($element offset($element from text("<data-reactid=w\"*{#variable}*\"  AND class=\"UFILikeLink\">"), 0), "Left Click", "No")

The example above works on this random FB page (make sure you are logged in before executing it).

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