Jump to content
UBot Underground

Basic Help - Click On Search Result An Go To Page


Recommended Posts

Hello all,

 

I have been working with bot for a short amount of time and have had pretty good success. Bot is fairly easy to learn. For some reason I can not get a basic click to work on search results. I have no problem adding variables and list or navigating. Picking one text of a page a and clicking on that result has me banging my head on the desk for 2 days.

 

This had lead me to watch the first 6 tutorials a few times and search the web with no result. Maybe this thread will help others too.

 

Currently I have the following working:

set variables

clear cookie

add proxy list

set proxy

navigate to search engine

enter text in box

click 

get search results

 

For some reason I can not figure out how to click on the link with my variable. It is a long keyword so will be unique to the page results. I have tried contains, page search with the same non working results :-(

 

Maybe I am completely making it harder than it needs to be or something else. I am just trying to get to a specific page currently.

 

here is my code

 

if($contains(#item title,#item title)) {

    then {
        alert("found it")
        click(<innertext=#item title>,"Left Click","No")
    }
    else {
        wait($rand(2,7))
        click(<id="pagnNextLink">,"Left Click","No")
    }
}
 
 
The alert is working so it seems to be finding the keyword on the page just not clicking it.
 
I am not trying to scrape any data only navigate.
 
Thanks for your help in advance.
 
 
 

 

Link to post
Share on other sites

For this you will want to use an offset, then loop through the results and if the title contains your keyword then click the link, quick example using Bing, it looks for "Twitter" but you can change it to be something like "Wikipedia" or whatever depending on the results you see:

navigate("http://www.bing.com/","Wait")
wait(1)
type text(<name="q">,"ubot studio","Standard")
wait(1)
click(<name="go">,"Left Click","No")
wait for browser event("Everything Loaded","")
wait(2)
set(#offset,0,"Global")
clear list(%num_results)
add list to list(%num_results,$scrape attribute(<class="b_algo">,"innerhtml"),"Delete","Global")
loop($list total(%num_results)) {
    set(#cur_title,$scrape attribute($element offset($element child(<class="b_algo">),#offset),"innertext"),"Global")
    if($contains(#cur_title,"Twitter")) {
        then {
            alert(#cur_title)
            set(#serp_id,$find regular expression($scrape attribute($element offset($element child($element child(<class="b_algo">)),#offset),"outerhtml"),"(?<=h\\=\\\").*?(?=\\\")"),"Global")
            click(<h=#serp_id>,"Left Click","No")
            alert("Since we navigated away from the search results im sotpping the script here")
            stop script
        }
        else {
        }
    }
    increment(#offset)
}
Link to post
Share on other sites

oh no how wrong I was, still not working. 

 

I use this in another bot and now I am trying to create my own as there are a few things I would like to change and add. Want to reduce that foot print ;-)

 

input("id","twotabsearchtextbox","value","$search_term")
input("value","Go","click")
 
SearchLink:
sleep(5)
$link=a("title","$LinkTitle","click")
 
if_1("$link"~="http")
sleep(60)
exit()
end_if_1
 
a("title","Next Page","click")
goto("SearchLink")
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...