sidram 0 Posted February 3, 2016 Report Share Posted February 3, 2016 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 variablesclear cookieadd proxy listset proxynavigate to search engineenter text in boxclick 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. Quote Link to post Share on other sites
allcapone1912 7 Posted February 3, 2016 Report Share Posted February 3, 2016 because you use to click on item with exact name "#item title", and there no such items on your pagealert just popup you the item that contain(not exact match) "#item title" Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 3, 2016 Report Share Posted February 3, 2016 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) } Quote Link to post Share on other sites
sidram 0 Posted February 4, 2016 Author Report Share Posted February 4, 2016 Thank HelloInsomnia The offset did the trick. Thanks a ton for helping a new guy out :-) Quote Link to post Share on other sites
sidram 0 Posted February 5, 2016 Author Report Share Posted February 5, 2016 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 ;-) navigate("http://goo.gl/59De5j")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") Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 5, 2016 Report Share Posted February 5, 2016 Can you post the Ubot code? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.