Sunday, August 6, 2017

How to do a google search

This is a very basic function that I writen to do a simple google search.

Firstly, I will create a custom function base on build-in function. for example. I called my function is GoogleSearch with 2 parameters: keyword and targetXpath (for finding and clicking).



function GoogleSearch(keyword, targetXpath)
{
    SetById ("lst-ib", "value", keyword);
    Delay (500);
    ClickById ("lst-ib", 2);
    ClickByXpath (GenerateXpath ("input", "name", "btnK"));

    Delay (10000);
    hasMySite         = GetAttribute (targetXpath, "href");

    if(hasMySite)
    {
        ClickByXpath (targetXpath);
    }
}


Delay (25000);
searchTargetXpath = GenerateXpath ("a","href","https://whoer%"); 
GoogleSearch("whoer.net", searchTargetXpath);
 
Once function has been declared. I now may call it. 
 
And then put it to work on 9hits panel like this.
 

 
 
The function work like human.
1. Fill the keyword to the textbox (for eg: whoer.net).
2. Press search button and delay for 10s to load the results.
3. Find the target and check if it's exists (on first page).
In this example, my target  is a link has href attribute starts with https://whoer.net...
4. Click it and done.
 
you may open the Macro Editor inside the Viewer folder to test this.
 
Note: This is a simple macro and tested on Desktop user agent.
You may try to make it more complex to fit you need :)
 => Dont forget to take a look on our macro document to learn more ! 

4 comments:

  1. Thank you very much for this useful article. I like it. Buy Reviews Google 5 star,

    ReplyDelete
  2. Nice post include the code. Thanks man for sharing this here. I want to rank top by Google search by this keyword buy google places reviews. Thanks

    ReplyDelete
  3. Thank you again for all the knowledge you distribute,Good post. I was very interested in the article, it's quite inspiring I should admit. I like visiting you site since I always come across interesting articles like this one.Great Job, I greatly appreciate that.Do Keep sharing! Regards, Buy Pinterest Followers

    ReplyDelete