Imacros extraction
I just started using Imacros,so far so good. I'm attempting to scrap large amounts of information from tables and then delimit it in excel. However when I try and do so i'm told the info is all ready delimited. Any ideas how I can brake this information up or how it's being imported into excel? The extracted info appears in one cell as a long string with long s开发者_运维知识库paces in between? I bow down to anyone who can solve this problem!
VERSION BUILD=7300701 RECORDER=FX
TAB T=1
SET !DATASOURCE 130.csv
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !EXTRACT_TEST_POPUP NO
URL GOTO=http://www.autohausaz.com/index.html
SET !ERRORIGNORE YES
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:searchkeyword ATTR=ID:topsearchbox CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:IMAGE FORM=NAME:searchkeyword ATTR=NAME:searchbutton&&SRC:http://www.autohausaz.com/assets/images/topsearchbutton.gif
TAG POS=1 TYPE=TABLE ATTR=ID:dlGroups
TAG POS=3 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=brake.csv
A good way to extract data is using scripting interface. This is how you do it.
var macro;
macro ="CODE:";
macro +="TAG POS=1 TYPE=SOMEELEMENT ATTR=CLASS:someclass EXTRACT=TXT"+"\n";
iimPlay(macro)
var extractedtext=iimGetLastExtract();
The way to save data into a file is something else. This is a good thread that deals about that on iopus forum . saving data into file
iMacros forum is ok for searching the examples you want but people working on that forum are very slow in responses so you could wait too long for an answer or not get it at all. My advice is to use google and type "imacros" + what every you are searching for or simply look on their wiki page . iMacros Wiki
You can use EVAL to delimit the data if it is in constant format.
I see the tabular format of data, I think you want to scrape all of the data, I will suggest you make a javascript for this.
You can use the relative tag to get data of adjacent column into your CSV.
TAG POS=R1 TYPE=SPAN ATTR=* EXTRACT=TXT
精彩评论