Jump to content
UBot Underground

Why Ubot Fails To Detect Google Search Button ?


Recommended Posts

Hi,
 
Ubot 5 fails to click.
Test and see. Definitely following code fails to click Google's Search button on google homepage.
 
Code:3:1592629Ubot fails to run this IF/ELSE condition.
[code]
if($exists($element offset(<tagname="svg">,1))) {
    then {
        click($element offset(<tagname="svg">,1),"Left Click","No")
    }
    else {
        alert("ERROR ALERT:

Cannot detect \"Search Button\"!
Quitting the session.")
    }
}
[/code]
 
Context Code:
[code]
ui text box("Keywords",#ui textbox_keywords)
ui drop down("Max Results","10,20,30,40,50,60,70,80,90,100",#ui dropdown_max results)
ui save file("Save To",#ui save file_save to)
ui stat monitor("Total Results",$list total(%urls))
divider
divider
set(#max results,#ui dropdown_max results,"Global")
set(#keywords,#ui textbox_keywords,"Global")
set(#save to,#ui save file_save to,"Global")
divider
navigate("https://www.google.com","Wait")
wait for element(<name="q">,"","Appear")
wait($rand(1,5))
if($exists(<name="q">)) {
    then {
        change attribute(<name="q">,"value",$nothing)
        wait($rand(1,5))
        type text(<name="q">,#keywords,"Standard")
        wait($rand(1,5))
    }
    else {
        alert("ERROR ALERT: 

Cannot detect \"Search Box\"!
Quitting the session.")
        stop script
    }
}
set(#current url,$url,"Local")
comment("Click Search Button.")
if($exists($element offset(<tagname="svg">,1))) {
    then {
        click($element offset(<tagname="svg">,1),"Left Click","No")
    }
    else {
        alert("ERROR ALERT:

Cannot detect \"Search Button\"!
Quitting the session.")
    }
}
wait($rand(1,5))
clear list(%urls)
loop while($both($comparison($list total(%urls),"<= Less than or equal to",#max results),$either($exists(<id="pnnext">),$exists(<outerhtml="<span style=\"display:block;margin-left:53px\">Next</span>">)))) {
    add list to list(%urls,$scrape attribute(<tagname="a">,"fullhref"),"Delete","Global")
    set(#current url,$url,"Local")
    if($exists(<id="pnnext">)) {
        then {
            comment("Click for \"Next\" Result.")
            click(<id="pnnext">,"Left Click","No")
        }
        else {
            if($exists(<outerhtml="<span style=\"display:block;margin-left:53px\">Next</span>">)) {
                then {
                    comment("Click for \"Next\" Result.")
                    click(<outerhtml="<span style=\"display:block;margin-left:53px\">Next</span>">,"Left Click","No")
                }
                else {
                    alert("ERROR ALERTt: 

Cannot detect \"Link to NEXT Page\"!
Quitting the session.")

                    divider
                }
            }
            divider
        }
    }
    divider
    wait for browser event("Page Loaded","")
}
save to file(#save to,%urls)
[/code]
 
What's your code to get it to click the round search button that's on the leftside of the search box ?
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...