Jump to content
UBot Underground

Click on google Result


Recommended Posts

Hey Guys,

 

for several hours I am trying to create a bot which clicks on the google results of my homepage.

 

I enter a keyword in the ui text box and submit this to google. Thats ok so far. But then the Bot should select the result which links my domain. I tried chose attribute

<A class="l noline" onmousedown="" href="/url?sa=t&source=web&cd=1&ved=0CCAQFjAA&url=http%3A%2F%2Fwww.mydomain.com*

or

<A class="l noline" onmousedown="" href="http://www.google.de/url?sa=t&source=web&cd=1&ved=0CCAQFjAA&url=http%3A%2F%2Fwww.madomain.com%*

but all attemps faild.

 

Any suggestion ?

Link to post
Share on other sites

Can you scrape the innertext of the link that you need?

 

If so then use that text that you scrape for the criteria of the chose by attribut and then issue the click chosen.

Link to post
Share on other sites

Can you scrape the innertext of the link that you need?

 

If so then use that text that you scrape for the criteria of the chose by attribut and then issue the click chosen.

 

I dont know how to. I'll try it in other words.

1. Use google Germany http://www.google.de/

2. Search for "polar rcx5"

3. I want the bot to click on our page which is: www.sportuhren-profi.de/triathlon/353-polar-rcx5.html

 

I tried to set a variable with scrape choosen attribute, attribute innerhtml, but how to assign the innerhtml *sportuhren-profi.de ?

Link to post
Share on other sites

Here is a sample for Ver 4.x

 

clear list(%links)
navigate("http://www.google.com", "Wait")
type text(<name="q">, "Dog food", "Standard")
click(<name="btnG">, "Left Click", "No")
wait(3)
add list to list(%links, $scrape attribute(<class="l">, "innertext"), "Delete", "Global")
click(<innertext="polar rcx5">, "Left Click", "No")

 

Hope this help.

 

Praney

  • Like 4
Link to post
Share on other sites

Here is a sample for Ver 4.x

 

clear list(%links)
navigate("http://www.google.com", "Wait")
type text(<name="q">, "Dog food", "Standard")
click(<name="btnG">, "Left Click", "No")
wait(3)
add list to list(%links, $scrape attribute(<class="l">, "innertext"), "Delete", "Global")
click(<innertext="polar rcx5">, "Left Click", "No")

 

Hope this help.

 

Praney

I have the same question as RayMue, but unfortunately this code given from Praney★Behl isn't working for me (uBot 4 Pro) :S

Link to post
Share on other sites

I have the same question as RayMue, but unfortunately this code given from Praney★Behl isn't working for me (uBot 4 Pro) :S

 

There is no problem with the code. As I just picked up a title from the page for the search "Dog Food" is "polar rcx5" which may be changed in your case or not exist anymore. you need to pick the title of a page you want to click and replace it with "polar rcx5".

 

Hope it helps.

 

Praney

  • Like 2
Link to post
Share on other sites

Hm... I tried your code now with "UI text box", but so it isn't working. Here the code:

 

ui text box("Keyword", #keyword_to_search_for)
ui text box("Title to click", #title_to_click)
clear list(%links)
navigate("http://www.google.com", "Wait")
type text(<name="q">, #keyword_to_search_for, "Standard")
click(<name="btnG">, "Left Click", "No")
wait(3)
add list to list(%links, $scrape attribute(<class="l">, "innertext"), "Delete", "Global")
click(<innertext="#title_to_click">, "Left Click", "No")

 

Everything works fine, but not the last line (it doesn't click the title I wrote into the "title_to_click" box).

Link to post
Share on other sites

Hm... I tried your code now with "UI text box", but so it isn't working. Here the code:

 

ui text box("Keyword", #keyword_to_search_for)
ui text box("Title to click", #title_to_click)
clear list(%links)
navigate("http://www.google.com", "Wait")
type text(<name="q">, #keyword_to_search_for, "Standard")
click(<name="btnG">, "Left Click", "No")
wait(3)
add list to list(%links, $scrape attribute(<class="l">, "innertext"), "Delete", "Global")
click(<innertext="#title_to_click">, "Left Click", "No")

 

Everything works fine, but not the last line (it doesn't click the title I wrote into the "title_to_click" box).

 

same here, i have tried this code and i got no luck at all. maybe i have to change something on it to work. thanks for sharing though..

Link to post
Share on other sites

Hm... I tried your code now with "UI text box", but so it isn't working. Here the code:

 

Everything works fine, but not the last line (it doesn't click the title I wrote into the "title_to_click" box).

 

 

same here, i have tried this code and i got no luck at all. maybe i have to change something on it to work. thanks for sharing though..

 

Guys please look carefully. If you replaced the text with the variable you need to put the variable in {} so it is identified as a variable.

 

here is the code again with a variable:

ui text box("Keyword", #keyword_to_search_for)
ui text box("Title to click", #title_to_click)
clear list(%links)
navigate("http://www.google.com", "Wait")
type text(<name="q">, #keyword_to_search_for, "Standard")
click(<name="btnG">, "Left Click", "No")
wait(3)
add list to list(%links, $scrape attribute(<class="l">, "innertext"), "Delete", "Global")
click(<innertext="{#title_to_click}">, "Left Click", "No")

 

Hope it helps. :)

 

Praney

  • Like 2
Link to post
Share on other sites

Guys please look carefully. If you replaced the text with the variable you need to put the variable in {} so it is identified as a variable.

 

Hope it helps. :)

 

Praney

Haha Praney, thank you very much! You're right, but I think I did this in the Node-View.

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