Imacros 10.0.5 crx for chrome

First Steps

After you installed the iMacros extension in your browser you will see the iMacros icon in the toolbar, which is used to open the iMacros sidebar. First we recommend that you look at a few demo macros. After this start recording your own first macro. To get started, a simple website like this wiki or our company website are good. To record, open the iMacros panel and click record. When you are done recording, click the stop icon either in the panel or in the browser toolbar. The iMacros icon changes to a stop button with line counter during recording and replay. You can then playback the macro or view/edit the macro code.

The iMacros for Chrome Panel: You can start playing macros either from the iMacros panel or from your bookmarks or macros that are embedded into websites.

The iMacros icon changes to a stop button with line counter during recording and replay, or a play button when paused. The WAIT command displays the wait time as countdown.

The iMacros panel has a play loop button to run macros repeatedly. This can be useful for checking a certain web page status or for web testing. While the loop is running, the current loop number is stored in the !LOOP internal variable.

Example usage: Create a macro that refreshes the current page every 5 seconds:

 VERSION BUILD=1031208
 REFRESH
 WAIT SECONDS=5

Start the PAGE REFRESH macro with the LOOP button.

Spend some time to get familiar with this wiki, it has lots of in-depth information on all iMacros functionality, as well as have a look at the Resources page on the iMacros website.

Timeout as macro variable

There are three different timeout macro variables in iMacros:

!TIMEOUT_MACRO
Infinity by default. By setting it you limit the total time the complete macro is going to run before it is aborted with error code = -1930, and the following message: «A timeout of x seconds set by !TIMEOUT_MACRO variable has exceeded.»
This variable does not have any dependency with the other timeout variables.
!TIMEOUT_PAGE
It governs the maximum time iMacros waits for a single page to load, before stopping with error = -1330 and message «A timeout of x seconds set by !TIMEOUT_PAGE variable has exceeded.»
 !TIMEOUT is the same as !TIMEOUT_PAGE.
!TIMEOUT_DOWNLOAD
It sets the maximum time iMacros waits for a single file to download, before stopping with error = -1330 and message «A timeout of x seconds set by !TIMEOUT_DOWNLOAD variable has exceeded.» If no value is given, iMacros uses !TIMEOUT_PAGE.
!TIMEOUT_STEP, also !TIMEOUT_TAG
It controls how long (at most) iMacros tries to find an element (html, or image) on the page. If no value is given, iMacros uses 1/10 of !TIMEOUT_PAGE, although changing !TIMEOUT_STEP won’t affect !TIMEOUT_PAGE.
When playing a TAG, IMAGESEARCH, or IMAGECLICK command, iMacros looks for the element on the page once and waits what we call a «load check interval» (currently 1 second). Then it looks for the element again, and again, and as many times until it is found or !TIMEOUT_STEP is reached. In other words, !TIMEOUT_STEP is the number of times iMacros is going to retry the command (only TAG and IMAGESEARCH/CLICK). Setting !TIMEOUT_STEP to 0 (zero) leads iMacros to run the command only once, and setting !TIMEOUT_STEP to 10, for instance, will cause iMacros to process the subsequent TAG and IMAGESEARCH commands up to 11 times, if the element is not found before. That is, it waits for it 10 seconds at most.
When the element is not found within !TIMEOUT_STEP, iMacros stops with error = -1300 (or -1800 in case of Imagesearch), unless !ERRORIGNORE was set to YES.

Создание профилей в Firefox 35

Если неохота разбираться — вы можете сразу скачать мою оптимизированную версию Firefox 35.

Для наших iMacros-ботов мы будем использовать не самую актуальную версию браузера Firefox. Она шустрее и менее прожорливая, чем последние версии этого браузера.Небольшое примечание: до 39 версии FF присутствует 0-day уязвимость в библиотеке для чтения PDF-файлов — pdf.js.

  1. Качаем портабельную версию Firefox 35 отсюда — portableapps.com
  2. Давайте создадим папку под все наши ботоводные дела на диске с:(используйте именно диск c: — потом удобнее будет разворачивать ботофермы на VPS\VDS)
    C:\BOTS\
  3. Установите FireFox в папку C:\BOTS\ff35\
  4. Заходим в папку C:\BOTS\ff35\App\Firefox и удаляем следующие файлы:
    maintenanceservice.exe
    maintenanceservice_installer
    updater.exe
    updater.ini
    update-settings.ini
  5. Кликаем правой кнопкой мыши на файле firefox.exe и жмякаем «Создать ярлык». Открываем свойства созданного ярлыка и в поле «Объект» прописываем default — это будет имя нашего профиля. Примечание: если без создания профилей запустить несколько окон Firefox и в каждом из них iMacros-скрипт — то скрипты одновременно не будут работать, поскольку будет один процес firefox.exe на все окна. Чтобы в каждом окне обрабатывать разные макросы мы используем флаг «-no-remote», на самом деле это небольшой хак, но он позволяет запускать для каждого профиля свой отдельный процесс.

  6. Заходим в папку C:\BOTS\ff35\App\DefaultData и создаем в ней папку profiles
  7. После запуска браузера через ярлык, у нас автоматом создастся папка C:\BOTS\ff35\App\DefaultData\profiles\default
  8. Теперь мы можем копировать эту папку default много раз, не забывая переименовывать, чтобы создать кучу профилей.

Настройка быстродействия Firefox 35

  1. Тыкаем по созданному ярлыку(обязательно по ярлыку, а не по файлу firefox.exe) и у нас открывается браузер — лезем сразу в Настройки(Options).
  2. Основные настройки:

  3. Во вкладке Безопасность(Privacy) выключаем отслеживание(tracking)
  4. В расширенных настройках, делайте, как на скринах:

  5. Скачиваем iMacros 8.9.7 — эта версия самая стабильная, в более новых версиях(9+) есть различные критичные проблемы для написания кода.
    Далее идем в расширения, там нажимаем на шестеренка и выбираем «Установку расширения из файла«. Также убираем галочку автоматического обновления расширений. Мы устанавливаем расширение из файла не просто так. Помимо версии для ботоводства, я также для веб-разработки использую последнюю версию Firefox и там стоит другая версия iMacros. У меня раньше были проблемы, что при обновлении новой версии на более новую, также обновлялись плагины и иногда это каким-то образом сказывалось и на портабельной версии. Теперь же все прекрасно.

  6. После установки iMacros — заходим в его настройки(либо жмем на «Опции» справа в списке расширений, либо в самом окошке iMacros)
    На вкладке General — обязательно убираем галочку Show Javascript during replay(Показывать JS во время воспроизведения)
    Также сделайте себе отдельную папку и пропишите ее во вкладке Path(Пути). Я не спроста прошу все-все складывать в одну папку, а не по умолчанию в «Мои Документы» — вам это в будущем сильно поможет при масштабировании, например, нужно будет быстро развернуть бота на VPS — вы просто скопируете всю папку и готово!

    Жмем «Apply»(«Применить»).

  7. Заходим  — отключаем все-все плагины, должно быть вот так, у вас список плагинов может отличаться:

  8. Скачайте и установите расширение FasterFox. По умолчанию — там в настройках стоит максимальная производительность.
  9. Заходим в about:config и там добавляем ключ типа Boolean config.trim_on_minimize, присваиваем ему значение true.
  10. Там же меняем значения некоторых ключей:media.peerconnection.enabled = false  — так мы отключим WebRTC, через который можно спалить ваш настоящий ip, даже если вы используете прокси(проверить утечку)

Если вам лень настраивать самому — вы можете Скачать настроенную и оптимизированную сборку Firefox 35(+iMacros+FireBug).

Privacy

iMacros stores everything on your PC. In other words, no iMacros information is stored on our website. iMacros is not an online service. We never have access to your macros or scripts. This includes the feature. Even in this case our servers are not involved.

Technical background information for those who are interested in how it works:

Technically what happens if you call a URL that starts with javascript:(function()… is that if iMacros is installed in that browser, it intercepts the URL and executes the macro. That’s all and it happens locally on your machine. If no iMacros add-on is installed, then a simple web page is opened that provides the user with a download link to iMacros.

Passwords are stored encrypted with your master password inside the macro files. So even if somebody would get a hold of your macros, they will useless to him/her without your master password.

iMacros as Bookmarklets

You can rename, edit or delete your iMacros via your browser’s bookmark manager

If you are used to other iMacros versions, you might be surprised that iMacros for Chrome and iMacros for Firefox do not store its macros as text files. The reason for this is that web extensions can not access the file system. Instead we store macros as bookmarklets inside the regular browser bookmarking system.

As the macros are packed as bookmarklets, you can just drag & drop them to your bookmarks folder or bookmarks bar. This means you can take full advantage of Chrome and Firefox syncing to have your macros synced across computers. You can sync your iMacros macros just like normal bookmarks. And with the iMacros secure password encryption that means that you can even store login macros securely in the cloud.

Timeout in the iMacros Component for .NET

As explained above, the iimPlay timeout is the maximum time the scripting interface itself waits for an answer from the browser, before returning the control to the calling script. Now, with the component, *you* are the browser itself. So, this timeout makes no sense. Imagine the following situation:

When we consider the scenario above in the context of an application that uses the iMacros component, Bob becomes the component (just like the iMacros Browser) and there is no Alice or Alice’s mother. That is, of course, unless you decide to implement your own Alice (scripting interface) to work specifically with your iMacros component-based application. Then you could provide your own equivalent to the iimPlay timeout.

Tips for using iMacros browser extensions freeware

Some of iMacros functionality is now only available with a paid license. These are features we believe are most likely to be used in a business environment and should not affect hobby users of iMacros.

Because we think there is still a lot of value in the freeware, we would like to give you a few tips to overcome some of the limitations, if you would like to keep using the freeware for your personal tasks.

  1. Existing macro files can easily be copied to bookmarks through the clipboard: open the macro file in any text editor, copy its contents to the clipboard and paste over an existing bookmark macro which is open in the macro editor. If you do not have any bookmark macro, start recording to create one. Use SaveAs to save with a new name.
  2. Long macros can be divided in smaller chunks and played one after the other. Just be aware that variables and macro settings are reset after each play.
  3. To input data from CSV files, use an html file with a table where your data is displayed on a browser tab, see below. Tag the table elements from that tab instead of reading from a file. Excel can save a worksheet (an imported CSV file) to html.
 <html>
 <head>
   <style>
       .table
       {
           width: 100%
       }
       .row .cell
       {
           padding: 5px;            
           border: 1px solid black;
       }
       
   </style>
   <script>
       window.onload = function () {
           var datasource = document.getElementById('datasource');
           datasource.addEventListener('change', function (e) {
               var csvFile = datasource.files;
               var fileReader = new FileReader();
               fileReader.onloadend = function (e) {
                   var table = document.getElementById('table');
                   var lines = fileReader.result.split(/\r?\n/);
                   var n = 0;
                   lines.forEach(function (line) {
                       n++;
                       var tr = document.createElement("tr");
                       tr.setAttribute("class", "row");
                       tr.setAttribute("id", "row_" + n);
                       var cells = line.split(/,/);
                       var m = 0;
                       cells.forEach(function (cell) {
                           var td = document.createElement("td");
                           m++;
                           td.setAttribute("id", "cell_" + n + "-" + m);
                           td.setAttribute("class", "cell");
                           var text = document.createTextNode(cell);
                           td.appendChild(text);
                           tr.appendChild(td);
                       });
                       table.appendChild(tr);
                   });
               }
               fileReader.readAsText(csvFile);
           }, false);
       }
   </script>
 </head>
 <body>
    Select CSV file:
    <input type="file" id="datasource" />
    <div>Table with loaded CSV file:</div>
    <table id="table" class=table></table>
 </body>
 </html>

Good reasons to use iMacros

Save time

iMacros helps you perform your web chores quicker. Downloading, data entry and website testing — iMacros can do all that for you!

Save money

Why pay more for less? iMacros is THE low-cost web testing solution and it even outsmarts its US competitors in many features. Some of the competition charges as much as $30,000 and still has fewer capabilities than iMacros!

Flexible

Automate even the most complicated tasks with the Scripting Interface. Connect iMacros to your favorite programming language. Windows Scripting Host and Visual Basic example programs are included.

Be creative

Repetition is unavoidable, but you avoid almost all of it. Let iMacros take over the routine jobs, and save your precious time for the creative part.

The iMacros Graphical User Interface

We have invested a lot of effort in making the Graphical User Interface of the iMacros Browser and the iMacros for Internet Explorer as intuitive as possible. This section explains the basic elements.

The Main Window

The main window consists of three parts: the menu at the top, the iMacros sidebar on the left, and the browser window on the right. Web pages are displayed in the browser window using a tabbed interface just like other browsers. You control iMacros with the elements in the sidebar on the left.

The iMacros Sidebar

The iMacros sidebar is divided into two parts. The top half displays a tree view of all your macros when iMacros is stopped, and the current macro code when you are playing or recording a macro. Only files with a .iim or .iimx (encrypted macros) extension in the Macros folder are recognized by iMacros. The Macros folder is specified in the Path settings. The default macro folder is located in user Documents folder under iMacros\Macros.

On the lower part of the sidebar, you can find the controls for recording, playing and editing macros, as well as the controls to change general settings and to access help.

Tip:

Installation

The information here pertains to iMacros for Chrome and Firefox specifically.

Download and install the latest version of the iMacros extension from the respective browser web store. No administrative rights are required for the installation.

The extension corresponds to the free version, which can be used for non-commercial purposes to record and replay small macros stored as bookmarks. Some iMacros features are only available with a Personal Edition (or higher) license. This includes file access to play macro files, read/write CSV files, and other extended functionality as detailed in the table below:

Feature Free edition Paid version (any) Affected commands
Play macros Only as bookmarks, up to 50 lines. As bookmarks and files, any length
Record macros Only as bookmarks, up to 50 lines As bookmarks and files, any length
Save macros Only as bookmarks As bookmarks and files
Read input from CSV files No Yes !DATASOURCE
Save extracted data to file No Yes SAVEAS, SAVEITEM
Make screenshots of webpage No Yes SCREENSHOT, SAVEAS
Save stopwatch data to a file No. Data can still be referenced in macro via the !STOPWATCHTIME variable Yes !FILESTOPWATCH, !FOLDER_STOPWATCH
Profile macro performance No Yes !FILE_PROFILER

Add File Access

How iMacros for Chrome and iMacros for Firefox look when the file access module is not installed. Once it is installed, you will see the familiar treeview there.

Important:

  1. iMacros File Access is only available for Windows. Currently we do not offer a version for Mac or Linux.
  2. Only a license for Personal, Professional, or Enterprise v12 or later will work
  • Login to your account
  • Select My Products
  • Select your license
  • Click the Download link to download the installer for the File Access module.
  • After installing, the File Access module will automatically detect whether there is an iMacros license on the machine and only prompt you to enter your activation code if necessary
  • You may need to restart the browser after installing in order for the module to be detected
  • Please also read ScriptingInterface.readme.txt located in %localappdata%\Programs\iMacros after installing File Access!

Download from Progress Community account

Trouble Activating

If you encounter any errors or have any issues activating the license, please contact our Customer Service.

If activation was successful but you still see the File Access is not available message in Chrome, there might be a group policy blocking iMacros.FileAccess. Please, check with your system administrator whether this is the case.

Fine Tune TAG Commands

Normally the TAG commands work the way they are recorded by iMacros, but sometimes you need to manually fine tune them. If an error occurs during replaying a TAG command it might be due to one of the following problems.

Wildcards

Some websites are created dynamically from databases and the links contain unique numbers — the so-called session ID — each time you visit a page. While this technique helps the website owner it poses a problem to iMacros. This is because during recording the session ID, which is often part of links, was written into the macro as part of the TAG command. During replay the session ID is different, thus iMacros does not find the exact link and produces an error. The solution is to replace the changing part of a link (or extraction) with the * symbol, which is read by iMacros as a wildcard. The wildcard causes iMacros to accept any character where the * is placed.

Example

Tag line as recorded by iMacros:

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/kb/ki.dll/ke.kb.gz?kbb;532452&&2&&&&&nc ATTR=NAME:zipcode CONTENT=85250 

If you record the same macro a second time you will see that we get the same TAG line except for one number — this is the session ID the website is using.

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/kb/ki.dll/ke.kb.gz?kbb;532244&&2&&&&&nc ATTR=NAME:zipcode CONTENT=85250 

Replace the session ID with *:

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/kb/ki.dll/ke.kb.gz?kbb;*&&2&&&&&nc ATTR=NAME:zipcode CONTENT=85250  

Actually, you could also remove most or all of the static parts of the FORM information as well. Exactly how much you can remove depends on the website. You still need enough information for iMacros to uniquely identify the page element. In our example, the result looks like:

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/kb/* ATTR=NAME:zipcode CONTENT=85250

or even

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:* ATTR=NAME:zipcode CONTENT=85250

Notes

  1. Prior to v12.5, TXT: (without *) and TXT:* behave the same, meaning they will match any text value. Starting with v12.5, TXT: is no longer considered valid syntax and will raise a macro error. Note that syntax errors such as this cannot be ignored with SET !ERRORIGNORE YES.
  2. TXT:* is not the same as TXT: (without *). If only TXT: is used, this means you are looking for an element where the text attribute is «» (an empty string, i.e. no value), if you are using TXT:* this means that the text attribute can have any value (which is the same as omitting the text attribute altogether). This applies to any attribute, not just TXT.

VBS (Visual Basic Scripting)

The following examples are based on the Windows Scripting Host (WSH, VBScript) that is part of Windows.

  1. combine-macros.vbs Shows how to create a custom error report log file
  2. connect-to-ie.vbs Remote control Internet Explorer
  3. connect-to-fx.vbs Remote control Mozilla FireFox
  4. connect-to-cr.vbs Remote control Google Chrome
  5. connect-to-iimrunner.vbs Shows how to work with iimRunner.exe
  6. database-2-web.vbs Submit database information to a website. Shows how to query any database.
  7. extract-2-file.vbs Web scrape data into a plain text file.
  8. extract-2-database.vbs Web scrape data into a database.
  9. extract-and-fill.vbs Web scrape data from one website and submit it to a second website.
  10. file-2-web.vbs Submit information from a text file to a website (Method 1)
  11. file-2-web-method2.vbs Submit information from a text file to a website (Method 2)
  12. get-exchange-rate.vbs Extract exchange rate from a website. Runs in tray.
  13. get-response-times.vbs Measure response times and use them in script.
  14. iimRunner_ASP.vbs Connect to iMacros via iimRunner, like when using ASP or ASP.NET
  15. random-numbers.vbs Fill an online form with random numbers.
  16. send-macro-code.vbs Directly send macro code to iMacros instance instead of calling locally stored macros.
  17. self-test.vbs Run all iMacros demo macros and create a test report.
  18. stresstest.vbs Run several iMacros instances in parallel.
  19. Create loops with VBS Tutorial with screenshots
  20. Loop only parts of a macro Tutorial with screenshots

Important: iMacros can be controlled with the same syntax shown here in any Windows programming and scripting language. Please see also the Tutorials page.

How to execute

In order to execute scripts copied from this site or some other source, do the following:

  • open a new file (e.g. in notepad)
  • copy the VBS code to it
  • save it as *.vbs
  • run the script by double-clicking the vbs file)

Command Line Support

Neither Firefox Quantum, nor Chrome provide command line information for extensions, but user «cammarin» suggested a great way to use iMacros via the command line: Embed the iMacros bookmarklet in a local web page.

  1. Chrome only: Make sure that «Allow access to file URLs» is enabled for the iMacros extension as shown .
  2. Create a bookmark for the macro you want to launch
  3. Right-click on the bookmark in the browser (not in the iMacros sidebar) and select Edit
  4. In the URL field, copy the value of the e_m64 variable, e.g. everything between quotes where you see: var e_m64 = «…»
  5. Paste this value in place of the corresponding value for var e_m64 in the HTML file shown below

Example:

 <html>
     <body onload="window.setTimeout('document.getElementById(\'criimlaunch\').click();', 1000);">

        <script>
           var e_m64 = "UFJPTVBUJTIwSEVMTE8hJTBBVVJMJTIwR09UTyUzRGh0dHAlM0ElMkYlMkZpbWFjcm9zLm5ldCUyRiUwQVBST01QVCUyMEJZRSE";
        </script>

        <a id="criimlaunch" href="javascript:(function() {try{if(!/^(?:chrome|https?|file)/.test(location)){alert('iMacros: Open webpage to run a macro.');return;}
           var macro = {};macro.source = decodeURIComponent(atob(e_m64));macro.name = 'MacroBookmarklet';
           var evt = document.createEvent('CustomEvent');evt.initCustomEvent('iMacrosRunMacro', true, true, macro);
           window.dispatchEvent(evt);}catch(e){alert('iMacros Bookmarklet error: '+e.toString());}}) ();">Launch iMacros</a>

     </body>
 </html>

Example command line / batch file:

 "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" file:///D:/web/test.htm

«test.htm» is the local webpage with the bookmarklet.

Version History

Version 10.0.2, released July 9, 2018

This is the first version which supports Firefox Quantum (Firefox 57 and above). It is a complete new version for the Firefox Webextension API, which has more similarities with iMacros for Chrome than previous versions of iMacros for Firefox. In particular, there are some commands, variables, and functionality that were previously supported but currently are not mostly because the WebExtension API provided by Mozilla still lacks support for it.

  • Not supported in this version:
    • CLICK
    • EVENT, EVENTS
    • FILEDELETE
    • FILTER
    • ONDIALOG
    • PROXY
    •  !POPUP_ALLOWED
    •  !SINGLESTEP
    • File upload is not supported
    • iMacros for Firefox is disabled in Private Browsing mode due to restrictions in Firefox
    • The built-in Javascript scripting interface for playing .js files is no longer available. Please use the iMacros Scripting Interface (API) included with some of the iMacros paid editions. This API allows you to control Chrome and Firefox from external scripts and programs (C++, C#, Javascript, Python, Perl, etc.)
    • The imacros://run/ URI is no longer supported for running macros from the command line, however, .
  • The following commands and variables are newly supported in iMacros 10:
    • SIZE
    •  !FOLDER_DOWNLOAD
    •  !FOLDER_MACROS
    •  !IMAGEX, !IMAGEY
    •  !PLAYBACKDELAY
  • Known Issues:
    • Docking the iMacros panel (sidebar) can break the ability to drag and drop tabs in Firefox
    • Search and replace dialog no longer work in the macro editor due to Firefox CSP (Content Security Policy) for Web Extensions.
    • For security reasons in Firefox, you cannot navigate using URL GOTO to a privileged URL such as file:, data:, and about: (although about:home and about:blank are allowed)
  • Additional tweaks/enhancements made during the beta period:
    • Accept input and confirm PROMPT and other dialogs with a keyboard Enter
    • Editor Save and Save As buttons feedback on successful save
    • Changed Play button text to Resume when macro is paused
    • Added setting to ignore UnsupportedCommand errors bypassing parsing of line (use with care!)

Some examples

Here are a few examples of the most basic and most frequent operations you can perform with the iMacros Scripting Interface. We use Visual Basic for these samples, but they can easily be translated into any other language.

Running a macro from a Visual Basic script

First of all we create an iMacros object:

 Set iim1 = CreateObject ("imacros")

Then initialize it with iimOpen (you can add parameters to iimOpen to have the macro run in different browsers, in silent mode, etc.)

 iim1.iimOpen()

Then we call the macro with iimPlay. There are 3 ways to do this:

1. Specify the full path to the macro as a parameter for iimPlay()

 iim1.iimPlay("c:\users\john\desktop\mymacro.iim")

2. If the macro is located in the «Macro folder» specified in Edit — Options — Paths in iMacros, you can use just the name of the macro as a parameter for iimPlay()

 iim1.iimPlay("Demo-FillForm")

3. Use the code of the macro as a parameter for iimPlay(). In this case the macro should begin with «CODE:» and you should add a line break to the end of each line

3a. Use iimPlayCode to play dynamically generated macro code. With this method, the macro code need not begin with «CODE:»

Sending variables to a macro

If you need to pass some values into the macro, you must use the iimSet() command.

Please note, that you have to use iimSet() before every iimPlay()! You can’t just set it once and for all. That means if you use iimPlay() in a loop, iimSet() should also be in a loop before iimPlay(), because even if the values it sends to the macro don’t change, these values are erased between calls to iimPlay().

Checking for errors

You can simply check the return value of iimPlay() to make sure the macro ran successfully or you can use iimGetLastError() to see what the last error message was.

 iret = iim1.iimPlay("Demo-FillForm")
 If iret > 0 Then
   s = "Everything OK"
 Else
   s = iim1.iimGetLastError()
 End If
 MsgBox s

Exiting iMacros

At the end of your script, when you’re not planning to use the iMacros object anymore, please don’t forget to close iMacros with iimClose

 iim1.iimPlay("Demo-FillForm")
 iim1.iimClose()

Как пользоваться iMacros

Макрос в Мозиле запускается одной кнопкой. Соответствующая иконка появиться в панели быстрого доступа рядом с кнопкой меню настроек.

С левой стороны открывшейся вкладки с макрос-инструментом есть три кнопки основных действия:

Воспроизведение макросов – благодаря этой вкладке можно просматривать свои готовые или скачанные извне макросы.

Запись – создание скриптов для выполнения задач по автоматическому заполнению тех или иных форм.

Manage – управление настройками, помощь в освоение продукта и многое другое.

Примечание: Зайдя во вкладку «Manage», пользователь может нажать на кнопку «Помощь» и подробно изучить все возможности приложения iMacros. Все разделы очень подробно описывают пошаговые манипуляции с полезным приложением. Содержимое вкладки «Помощь» на английском языке. Пользователей, не владеющим в полной степени иностранным языком, не должно смущать это обстоятельство. Так как в браузере Mozilla Firefox можно установить дополнительное расширение-словарь и спокойно переводить все пункты на родной язык. Подробности, как воспользоваться он-лайн словарём в статье «переводчик для Firefox

Firefox iMacros – полноценный инструмент, готовый к незамедлительному использованию сразу после установки. Как и любое другое дополнительное расширение для интернет-обозревателя Мозила данное расширение легко как устанавливать, так и удалять в случаи необходимости.

С точки зрения безопасности и конфиденциальности пользовательской информации приложение iMacros абсолютно надёжно, так как сохраняет скрипты исключительно на персональном компьютере создателя. За благонадёжность других файлов, скачанных из сети интернет, пользователь несёт ответственность самостоятельно. Ведь любой инструмент можно использовать не только в благих целях, но и для наживы или причинения вреда другим.

Надёжный антивирус, бдительность и внимательность никогда и никого не подведут!

Frames

Frame in Object Tree

iMacros handles pages with frames automatically. It inserts FRAME statements that indicate to which frame the following TAG or similar command refers. Please note that TAG will fail if it is not directed to the correct frame.

If the frame has a name, iMacros will use it in the FRAME statement, otherwise its index (the position of the frame in the page’s object tree) is used.

Hint
When recording in the iMacros Browser or Internet Explorer, use Recording Mode = Expert (Complete HTML) to get the frame number as a comment in the recorded macro. Later you can edit your macro and decide which suits better to your needs. Some websites use random names but fixed indexes, in this case, it is better to refer to the frame number instead of the default frame name.

Variables

!Extract will hold the extracted value (e.g. extracted texts from tables to be used later at form filling)!loop holds the current loop counter value used when clicking play loopSET !FILESTOPWATCH C:\temp\demo-stopwatch.csv 

ADD will either add or append values to built in variables.

SET !VAR1 myDearFriendTAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:loginbox ATTR=ID:pass CONTENT={{!VAR1}}

————-

SET !VAR1 100 ADD !VAR1 -20 => Content of !VAR1 is 80. 

——-

SET !VAR1 Hello ADD !VAR1 <SP>World<SP> ADD !VAR1 2010 => Content of !VAR1 is Hello World 2010

How to display the content of a variable?

For testing and debugging macros it can be useful to display the
content of some variables. You can divert the PROMPT command from its
intended use for this purpose. If you want to display the value of the
two variables, !COL2 and MY_VARIABLE, use the following command

PROMPT {{!COL2}} {{!VAR1}} {{MY_VARIABLE}} 

This will open an input dialog for !VAR1. This is the main purpose of
a PROMPT command, but for our current use of the command this can be
ignored. The input dialog box displays the value of {{!COL2}} as dialog
box text and the value of {{MY_VARIABLE}} as input box default value.
This allows you to check if these variables are populated correctly.

Search : SEARCH SOURCE=TXT:»_gat._getTracker(\»UA-336765-1\»)»‘Check for Script, ignore caseSEARCH SOURCE=TXT:»_gettracker» IGNORE_CASE=YES’Use regular expression to extract dataSEARCH SOURCE=REGEXP:»_get(racker)\\((+)\\)» EXTRACT=»$1 is $2»

WAIT SECONDS=(n|#DOWNLOADCOMPLETE#)BACK

Javascript Scripting Interface

Automate complex tasks: iMacros commands refer to web page elements, so any programming logic must be put into a script that then uses iMacros to automate the website. For this purpose iMacros for Firefox contains a built-in Javascript Scripting Interface, which runs directly inside the browser. Just like Firefox this interface is cross-platform (Win, Mac, Linux).

The following information focuses on this built-in Javascript Scripting Interface.

Supported commands:

  • iimDisplay
  • iimSet
  • iimPlay
  • iimPlayCode
  • iimGetExtract
  • iimGetErrorText

Note that the syntax of the regular, commercial Windows Web Scripting Interface and the built-in Firefox Javascript Scripting Interface is identical (unless where explicitly noted). Therefore they use the same documentation.

By default each Javascript step is shown during replay. This option is useful for testing and debugging, but it slows down the Javascript execution artificially. To run Javascript at its normal (very fast) speed please uncheck this option.

Javascript code running inside iMacros. The the //imacros-js:showsteps yes/no comment at the top of your Javascript file (including the //) overrides the global setting of «Show Javascript» checkbox in the option dialog.

Examples:Self-Test.jsView Script Source Code

Important: iMacros macros must have the «.iim» file extension and Javascript scripts must have the «.js» file extension.

Note: Firefox can be remote controlled by the regular iMacros Scripting Interface via iimInit («-fx»). The Javascript Scripting Interface does not include iimInit and iimExit, because they are not required. The Javascript runs inside the browser. The regular iMacros Scripting Interface is now available for Linux. It allows you to remote control Firefox and Chrome via Python.

Macros

TAG

The TAG command selects HTML elements from the current website. Element is chosen based on parameters:

POSTYPE
A: anchor (link)

FORM
FORM=ID:Form1

ATTR
ATTR=TXT:some_nameATTR=HREF:some_url

XPATH:
TAG XPATH=»//*/div/center/table/tbody/tr/td/small/input» CONTENT=»Tom Tester»

EXTRACT: Optional, specifying the type of extraction to perform
TXT
Plain text extraction, all HTML tags are taken out. When used with a drop-down list (select element), it extracts the selected (visible) entry.
TXTALL
For use with a drop-down list (select element). It extracts all entries of the list.
HTM
The full HTML of the element the points to. Note: In the iMacros Browser and IE the HTML tags are always returned in caps. So <b>test</b> is extracted as <B>test</B>.
HREF
The URL of the page element the extraction anchor points to.
ALT
The alternative text of an image the extraction anchor points to.
CHECKED
Status of a checkbox or radiobutton. It returns «true» when the box is checked, otherwise «false» Note: When extracting text from input boxes (TAG command contains «TYPE=INPUT»), there must not be a «CONTENT» parameter.
If the result is #EANF# (Extraction Anchor Not Found) you will need to
alter the extraction anchor in order to successfully extract the data.

If the returned element is a link, it is followed (like clicking the link).

Clearing Cookies and Cache

When you clear the browser history in Firefox, iMacros stored data is also removed. Thus all your iMacros preferences are lost. iMacros will work again, but you preferences will be reset to their defaults. This also happens if you set Firefox to Clear history when Firefox closes in about:preferences#privacy.

The CLEAR command, on the other hand, does not delete iMacros data, while clearing cache and cookies. It also accepts an argument to filter the cookies to be cleared by domain name. Using CLEAR with no argument clears all cookies and cache. Using e.g.

CLEAR facebook.com 

will clear all of the cache, but only cookies from Facebook. If you only want to clear the cache, then specify a nonexistent domain name

CLEAR xxx.yyy.zzz
Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector