Demo-Extract
From iMacros
This demo shows the use of the extract command.
This demo works with the following page: http://www.iopus.com/imacros/demo/v5/extract2/
Macro Code
VERSION BUILD=4201129 TAB T=1 TAB CLOSEALLOTHERS URL GOTO=http://www.iopus.com/imacros/demo/v5/extract2/ ' 'The extraction commands in this example are created the by extraction wizard 'and then manually edited to fine tune them (e. g. add the keyword part and replace 'lengthy and/or changing parts by "*" ' ' The SET and SAVEAS statements were added to demonstrate saving extracted content.manually to write the extracted table to a file '(The alternative way to get the extracted data is the Scripting Interface) 'clear extract variable by assigning current content to variable 'This is done because we only want to save the next two extracted values SET !VAR1 !EXTRACT 'Add date and time SET !EXTRACTADD {{!NOW:yyyy/mm/dd}} SET !EXTRACTADD {{!NOW:hh:nn:ss}} EXTRACT POS=1 TYPE=TXT ATTR=<TD<SP>class=bdytxt<SP>width="52%">* FILEDELETE NAME=myextract.csv SAVEAS TYPE=EXTRACT FOLDER=* FILE=myextract.csv ' EXTRACT POS=1 TYPE=HTM ATTR=<SPAN<SP>class=bdytxt>* ' EXTRACT POS=1 TYPE=HREF ATTR=<A<SP>*>*links* EXTRACT POS=1 TYPE=TITLE ATTR=<A<SP>*>*links* ' EXTRACT POS=1 TYPE=ALT ATTR=<IMG<SP>height=90<SP>alt="* ' EXTRACT POS=1 TYPE=ALT ATTR=<INPUT*abc* EXTRACT POS=1 TYPE=TXT ATTR=<INPUT*xyz* ' EXTRACT POS=5 TYPE=TXT ATTR=<table*mytable*
