iMacros



Google chrome, Mac, imacros error message: "Install file access support first" install it from here.


The grantor is the party selling the property, the grantee is the person who bought it.



At cases that there is not really any difference on the items you want to extract but their occurrence in a table if they have labels, it's better extract the label and then extract the item you are interested in in a relative fashion



newdeeds.pl  working.pl

extract a row and split based on TD


keep content in quotation marks:
TAG POS=1 TYPE=TEXTAREA FORM=NAME:TestForm ATTR=NAME:Remarks CONTENT="Clipboard content = {{!CLIPBOARD}}"

INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);

Date
  • YYYY-MM-DD
  • Date Range: 1000-01-01 to 9999-12-31

$query_manual = "INSERT INTO dateplayground (dp_name, dp_date)
VALUES ('DATE: Manual Date', '2020-2-14')";






iMacros directory: Documents\iMacros
Logs - nested in the above dir

iret = iim1.iimSet("myvar", str)


variable name inside a macro:   content = {{companyName}}


--------------------

Macros

TAG

The TAG command selects HTML elements from the current website. Element is chosen based on parameters:
POS
TYPE
A: anchor (link)
FORM
FORM=ID:Form1
ATTR
ATTR=TXT:some_name
ATTR=HREF:some_url
XPATH:
TAG XPATH="//*[@id='TestForm']/div/center/table/tbody/tr[1]/td[3]/small/input[1]" 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 [[Extraction_Anchor|extraction anchor] 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).

'URL GOTO=http://deed.co.travis.tx.us/RealEstate/SearchResults.aspx
TAG POS=1 TYPE=TR FORM=ID:Form1 ATTR=ID:gxG1_r_* EXTRACT=TXT

//table loop
Do
Loop Until extractedValue="#EANF#"



--------------------

Variables

There are four built-in variables, !VAR1, !VAR2, !VAR3 and !EXTRACT and !loop and !clipboard.
!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 loop

SET !FILESTOPWATCH C:\temp\demo-stopwatch.csv 

ADD will either add or append values to built in variables.
SET !VAR1 myDearFriend
TAG 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.

------------------------------

Sub CheckErr(retCode)

    If retCode < 0 Then
        MsgBox im.iimGetLastError(), vbCritical, "Macro Error: " & retCode
        WScript.Quit()
    End If
   
End Sub



Search : searches page source instead of DOM as in extract
SEARCH SOURCE=TXT:"_gat._getTracker(\"UA-336765-1\")"
'Check for Script, ignore case
SEARCH SOURCE=TXT:"_gettracker" IGNORE_CASE=YES
'Use regular expression to extract data
SEARCH SOURCE=REGEXP:"_get([Tt]racker)\\(([^)]+)\\)" EXTRACT="$1 is $2"

WAIT SECONDS=(n|#DOWNLOADCOMPLETE#)

BACK

iMacros Caller

$iim1->iimSet("-var_macroPosVal",$recordIndexInPage );
$s = $iim1->iimPlay( "CODE:".$macro_TravisExtract);
$extractedValue = $iim1->iimGetLastExtract;


iimGetLastExtract () - returns all extracted information at once
iimGetLastExtract (0) - returns all extracted information at once
iimGetLastExtract (1) - returns 1st extracted data
iimGetLastExtract (2) - returns 2nd extracted data (and so on)












Comments