Demo-Extract

From iMacros
Jump to: navigation, search

This demo shows the use of tag's extract parameter (The EXTRACT Parameter).

Macro Code

VERSION BUILD=10.4.28.1074
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=http://demo.imacros.net/Automate/Extract2
TAG POS=1 TYPE=TD ATTR=CLASS:bdytxt&&TXT:* EXTRACT=TXT
TAG POS=1 TYPE=A ATTR=TXT:H*links* EXTRACT=TITLE 
TAG POS=1 TYPE=SPAN ATTR=CLASS:bdytxt&&TXT:* EXTRACT=HTM  
TAG POS=1 TYPE=A ATTR=TXT:HREF<SP>extracts<SP>links EXTRACT=HREF  
TAG POS=1 TYPE=IMG ATTR=SRC:*shark_thumbnail.jpg EXTRACT=ALT         
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:abc EXTRACT=TXT 
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=ID:TF2 EXTRACT=TXT 
TAG POS=2 TYPE=TABLE ATTR=TXT:*My* EXTRACT=TXT  
TAG POS=1 TYPE=TD ATTR=CLASS:bdytxt&&TXT:* EXTRACT=TXT 
'
'Relative extraction
'
'1. Mark reference (anchor) element
TAG POS=1 TYPE=TH ATTR=TXT:MyTable
'2. POS value is RELATIVE to the anchor element   
TAG POS=R3 TYPE=TD ATTR=TXT:* EXTRACT=TXT 
'The extracted values will be stored in the csv file under the iMacros Download folder
SAVEAS TYPE=EXTRACT FOLDER=* FILE=+_{{!NOW:yyyymmdd_hhnnss}}