So, you’re the proud owner of Web Human Emulator.
Then install the program itself Human Emulator. When installing, the program will “system code”, which is necessary to “exchange” for tech support for an activation code.
After entering the code, see the program interface.
To get started, you need to get acquainted with the basic functions of the program and understand the principle of the program.
For example, we open a browser, enter the site address in the Address bar, then using the keyboard or mouse, enter data into forms that are present in open our page. With this program, Human Emulator can be traced all the movements made by us on the page.
What movement will “remember” the program can be set in Tools->Settings->Macro.
The program is rounding up three types of events:
- Mouse movements;
- Input from the keyboard;
- Clicks the mouse.
In most cases, when filling out fields, mouse movements, we would not be required, so ticks can be left just in front of two values: “to catch key events” and “catch events clique. Save the settings selected by us.
Now go straight to work with the page, a script to fill in where we want to write.
If we look closely at the window, we see that it is divided into two panes: the left and right. On the right is a browser, and in the left editor. If the editor is not visible, you can see by clicking on the View menu->left pane.
We start with the script. In the menu click the macro->record, or simply typing Ctr+Shift+R. In the left pane of the program will see that there is a new tab and it is this entry:
<? php
//The following code is required to properly run Human Emulator
require("../Templates/web_human_emulator.php ");
//Quit
$app->quit();
?>
Note:
require("../Templates/web_human_emulator.php ");
the code needed to run the emulator. On my PC reason with a relative path, this code does not work, so I now have entered the following code:
require("C:/Program Files/Web/Human Emulator/Templates/web_human_emulator.php");
In the right pane, in the address line of code we write url page, for example: http://www.xanga.com/register.aspx and click press Enter.
Page opens, which we will fill.
In the left pane immediately see the changes:
<? php
//The following code is required to properly run Human Emulator
require('../Templates/web_human_emulator.php ');
$browser->navigate('http://www.xanga.com/register.aspx');
$browser->wait_for(240,1);
//Quit
$app->quit();
?>
More on the page(in the right pane), fill the fields, but left immediately see the changes.
<? php
//The following code is required to properly run Human Emulator
require('../Templates/web_human_emulator.php ');
$browser->navigate('http://www.xanga.com/register.aspx');
$browser->wait_for(240,1);
$input->set_value_by_name('registrationModule $txtUsername', 'janberb');
$input->set_value_by_name('registrationModule $txtPassword1', 'janberb1');
$input->set_value_by_name('registrationModule $txtPassword2', 'janberb1');
$input->set_value_by_name('registrationModule $txtEmail', 'janberb@gmail.com');
$input->set_value_by_name('registrationModule $txtLetters', 'mmsot');
$listbox->select_name_by_inner_name('registrationModule $DOB_month', '1 ');
$listbox->select_name_by_inner_name('registrationModule $DOB_day', '28 ');
$listbox->select_name_by_inner_name('registrationModule $DOB_year', '1958 ');
$checkbox->click_by_name('registrationModule $chkReadTerms');
$browser->wait_for(240,1);
$button->click_by_name('registrationModule $createAccountButton');
$browser->wait_for(240,1);
//Quit
$app->quit();
?>
There has to stay. Click through the menu in the program Macro->Stop, or simply typing Ctr+Shift+R.
While we consider the details obtained by the script code to understand the principle of the program.
Let’s start with the line:
$input->set_value_by_name('registrationModule $txtUsername', 'janberb');
If you decipher the instructions of this line, we get here is:
input – insert
set_value_by_name – assign a value to the name;
registrationModule $txtUsername – who prisovit(specify name of the field);
janberb – value of the field, which we introduced by hand.
With input and set_value_by_name, I think, clearly, this program functions, but in order to understand where does registrationModule $txtUsername consider the code page http://www.xanga.com/register.aspx
With the program to do it simply. Open the page again in the browser program. Coming menu click Debug->Renumber->input field or Ctrl+Alt+I. We see that in the input fields that has appeared. For example, in the field “Choose Username” see: “0 registrationModule $txtUsername”, where 0 – is the number of fields, and
registrationModule $txtUsername field name.
Also, can be numbered not only the input field, but also other elements of the page and see what values it will take the field, depending on what is enumerated.
Understand what is taken from, you can return to the script, which we turned.
Looking closely to the registration page we see that the input field it is as if all known in advance, except the input field CAPTCHA(a capture on the registration page every time new), so the resulting script to convert the line:
$input->set_value_by_name(‘registrationModule $txtLetters’, ‘mmsot’); in such form that when you run the finished script, we could introduce a capture by hand.
The new design will look like:
$captcha = $app->dlg_captcha_from_image_number(1);
$input->set_value_by_number("4", $captcha);
guess, where have the numbers 1 and 4 can be, but even so let’s see where they come from.
In the script, which the program itself was mostly used on behalf of the numbering name, but you can use any other numbering. For example, entering captcha can be used in the numbering of the picture. Click Debug->Renumber->Images(Ctrl+Alt+P), induces a mouse at the picture and see the captcha surfaced figure 1. Proceeding from this, and we have
$captcha = $app->dlg_captcha_from_image_number(1);
Immediately look at that in a field where we are entering a capture, there is a value: “4 registrationModule $txtLetters”, hence there and took the number 4 in the string $input->set_value_by_number(“4″, $captcha);.
In the end, we have turned out so cute that’s the script:
<? php
//The following code is required to properly run Human Emulator
require("c:\Program Files\Web\Human Emulator/Templates/web_human_emulator.php ");
$browser->navigate('http://www.xanga.com/register.aspx');
$browser->wait_for(240,1);
$input->set_value_by_name('registrationModule $txtUsername', 'janberb');
$input->set_value_by_name('registrationModule $txtPassword1', 'janberb1');
$input->set_value_by_name('registrationModule $txtPassword2', 'janberb1');
$input->set_value_by_name('registrationModule $txtEmail', 'janberb@gmail.com');
$captcha = $app->dlg_captcha_from_image_number(1);
$input->set_value_by_number("4", $captcha);
$listbox->select_name_by_inner_name('registrationModule $DOB_month', '1 ');
$listbox->select_name_by_inner_name('registrationModule $DOB_day', '28 ');
$listbox->select_name_by_inner_name('registrationModule $DOB_year', '1958 ');
$checkbox->click_by_name('registrationModule $chkReadTerms');
$browser->wait_for(240,1);
$button->click_by_name('registrationModule $createAccountButton');
$browser->wait_for(240,1);
//Quit
$app->quit();
?>
Verify its efficiency. For this menu, select Debug->Run. Everything works! So the first stage of the development of the script is passed successfully.