Jump to content
UBot Underground

[Help]Guttefrage Thumbs up Bot


Recommended Posts

I took a quick look. 

 

When you select the thumbs up element you have to move the mouse up to the number a little bit. So that the blue area and the number is slected.

 

Wrong:

<tagname="a">

 

Correct:

<class="diggIt">

 

The right click element is:

click($element offset(<class="diggIt">, 3), "Left Click""No")

 

There the numbers don't change. They are in the exact order. 

 

Now you only have to figure out the correct position. Scraping all the usernames into a list and then finding the name you are looking for should give you the right position. 

But be careful! The element number starts with 1  and the list starts with 0. So if the username is list item2, then the element is 3.

 

Dan

  • Like 1
Link to post
Share on other sites

I took a quick look. 

 

When you select the thumbs up element you have to move the mouse up to the number a little bit. So that the blue area and the number is slected.

 

Wrong:

<tagname="a">

 

Correct:

<class="diggIt">

 

The right click element is:

click($element offset(<class="diggIt">, 3), "Left Click""No")

 

There the numbers don't change. They are in the exact order. 

 

Now you only have to figure out the correct position. Scraping all the usernames into a list and then finding the name you are looking for should give you the right position. 

But be careful! The element number starts with 1  and the list starts with 0. So if the username is list item2, then the element is 3.

 

Dan

Tried that also, seems like it's not clicking on thumbs up. Maybe I'm doing something wrong. You tested it by run node?

Link to post
Share on other sites

Hmm... It's not clicking the element for me either... In HTTP mode I would know a solution :-)

But the click elements stuff is a bit strange. 

 

I played around with:

click($element child($element offset(<class="diggIt">, 6)), "Left Click""No")

 

But that didn't work either. I'm not sure if $element child does work with the click command?

 

Dan

Link to post
Share on other sites

Hmm... It's not clicking the element for me either... In HTTP mode I would know a solution :-)

But the click elements stuff is a bit strange. 

 

I played around with:

click($element child($element offset(<class="diggIt">, 6)), "Left Click""No")

 

But that didn't work either. I'm not sure if $element child does work with the click command?

 

Dan

 

Hi, you'll need the sibling of the child of the offset (lol, if it wasn't confusing enough already  :rolleyes:):

 

click($element sibling($element child($element offset(<class="diggIt">, 2))), "Left Click""No")

 

All the best,

Marton

  • Like 1
Link to post
Share on other sites

Hi, you'll need the sibling of the child of the offset (lol, if it wasn't confusing enough already  :rolleyes:):

 

click($element sibling($element child($element offset(<class="diggIt">, 2))), "Left Click""No")

 

All the best,

Marton

Hmm.. that's interesting. 

 

Could you show an example with the html code of that site?

 

The answer element starts with:

<div class="answer clearfix">

 

Then the elements I already voted on have:

<div class="diggedIt">3</div>

 

and the elements I didn't vote yet have:

<div class="diggIt">0</div>

 

So we are selecting the diggIt class.

 

Then with element child we select <div class="answer clearfix"> right?

 

But I don't understand what element we click now exactly?

 

I'm confused...I'm more used to fiddler traces these days :-)

Dan

Link to post
Share on other sites

 

how can I find the position of a username in a list? for example I have a list of 5 elements as it follows:

a

b

c

d

e

and I want to store inside a variable the position of the fourth element, "d", which is 4

 

Lists a zero based so d is list item 3

 

clear list(%items)

add list to list(%items$list from text("a

b

c

d

e

f"$new line), "Delete""Global")

set(#find"d""Global")

set(#listposition$eval("var items = [\"{$replace(%items, $new line, "\",\"")}\];

var position = items.indexOf(\"{#find}\");

position;"), "Global")

Link to post
Share on other sites

WTF I ran it and debugger gave me -1 instead of 4. Hmmm

Lists a zero based so d is list item 3

 

clear list(%items)
add list to list(%items$list from text("a
b
c
d
e
f"$new line), "Delete""Global")
set(#find"d""Global")
set(#listposition$eval("var items = [\"{$replace(%items, $new line, "\",\"")}\];
var position = items.indexOf(\"{#find}\");
position;"), "Global")

Link to post
Share on other sites

crespozooo,

 

You could do it like this:

 

clear list(%items)
add list to list(%items$list from text("a
b
c
d
e
f"$new line), "Delete""Global")
set(#find"d""Global")
set(#Current_List_Position, 0, "Global")
loop while($list total(%items) > #Current_List_Position) {
    if($list item(%items#Current_List_Position) = #find) {
        then {
            set(#listposition#Current_List_Position"Global")
            alert("Found it at position: {#listposition}")
            set(#Current_List_Position$add($list total(%items), 1), "Global")
        }
        else {
            set(#Current_List_Position$add(#Current_List_Position, 1), "Global")
        }
    }
}

Link to post
Share on other sites

go into the eval
then replace
where it says replace text
and the value is "," 
quote the input so it is not parsed as a maths expression

 

 

I think that's your problem

Link to post
Share on other sites

crespozooo

Yes, there is probably a work-around but I don't think we have enough information to suggest one.

 

Well let me make myself clear.I want to scrape all users from the answers because I need the order,to know on which position is my user(ex:5) and to click the 5th thumbs up button. Thing is there are replies to the answers also. And replies to the replies(which do not have a thumbs up button) which causes to fck up my order. Get it now? Like there will be more users than thumbs up buttons. 

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