Jump to content
UBot Underground

How to click on google link when SERP?


Recommended Posts

I am trying to create my first bot.  I am looking to scrape google for keyword and store the results in a list.  I saw the tutorials and this part works fine.

 

I now want to click on one of the links - say for example the list item #7.  It seems that I tried the click, I tried load html and I tried navigate commands with various permutations and combinations - but nothing worked.

 

My code is as follows:

 

clear cookies
set referrer("http://www.google.de")
set user agent("Chrome")
navigate("http://www.google.com", "Wait")
wait($rand(4, 10))
type text(<name="q">, "dog training", "Standard")
wait($rand(2, 8))
click(<name="btnK">, "Left Click", "No")
wait(4)
clear list(%list search urls)
add list to list(%list search urls, $scrape attribute(<class="l">, "fullhref"), "Don\'t Delete", "Global")
 

Does anybody know what command to use for clicking, for example the number 7 URL on the Google search page?

 

 

Link to post
Share on other sites

Hi,

 

Sample code:

set(#clickonlistitemnumber, 6, "Global")
set(#clickonthisitem, $list item(%list search urls, #clickonlistitemnumber), "Global")
click(<href=#clickonthisitem>, "Left Click", "No")

or

set(#clickonlistitemnumber, 6, "Global")
click(<href=$list item(%list search urls, #clickonlistitemnumber)>, "Left Click", "No")

Ubot Studio lists tip. Ubot Studio lists start at 0. List Item 6 is the 7th URL on page.

 

Thanks,

Kevin

 

ps. You may have Ubot Studio forum restrictions in place. This Ubot Studio forum topic has what you need to do to have the restrictions lifted. http://www.ubotstudio.com/forum/index.php?/topic/7731-getting-errors-posting/

  • Like 1
Link to post
Share on other sites

Thanks both @bestmacros and @k1lv9h - I will try your suggestions.

 

@K1v9h - As I am new to ubot perhaps I am restricted.  I will follow your link to get it removed.  Thanks again.

Link to post
Share on other sites
  • 4 weeks later...

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