Wednesday, November 25, 2009

Script for search data through Google. Part1.

With Web Human Emulator you can find and collect various information using the search engine Google.

Let's write a script.

First of all you create a new script using the menu New. The result is the following code:



Then we run the script is executed using the Run button or hot key F5. After running the script in the browser will open Google:



Set the cursor in the php editor to line 9 and then select the Google search box. After, click on the field right mouse button and result we get context menu:



Push the menu $input, and we see the menu with functions for this object.



We click on the $input->set_value_by_name("q ",""); menu item and this line appears in the PHP editor and we have next code in the PHP editor:



Add a search word or phrase in the function $input->set_value_by_name("q ",""); and have for example $input->set_value_by_name("q","car for sale");. Run script for execution and eventually have such a result.



After we click the right mouse button on the button "Search in Google" and see the popup menu.



Roll over $button and see a drop-down menu with the object $button functions. Click on $button->click_by_name("btnG");. This line appears in the PHP editor. Copy string $browser->wait(1); and paste it after $button->click_by_name("btnG"); In result we have follow code:


Run the script and we have next result:



Thus we have the first part of the script - search for a specific query in Google and receive search results. Now we need to write a second part to find needed information and parsing it in the needed format. To be continued ...

No comments:

Post a Comment