Can't save extracted data into a continuously appending csv

Discussions and Tech Support specific to the iMacros for Chrome extension.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
purenoni
Posts: 6
Joined: Wed Apr 09, 2014 4:20 am

Can't save extracted data into a continuously appending csv

Post by purenoni » Wed Apr 09, 2014 4:30 am

What am I doing wrong? :roll:

I am trying to extract 3 fields fields from a website.

I am getting the script to extract everything OK, I just need to save the captured fields to one continually appending csv file.

I am using iMacros for Chrome. Thank you so much for your help!!

VERSION BUILD=8810214 RECORDER=FX
TAB T=1
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=5
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=iosepa
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\teacher\Downloads FILE=heco.csv
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=5
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=kula
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\teacher\Downloads FILE=heco.csv
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=5
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=moana
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\teacher\Downloads FILE=heco.csv
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=5
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=puuahi
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\teacher\Downloads FILE=heco.csv
chivracq
Posts: 9179
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can't save extracted data into a continuously appending

Post by chivracq » Wed Apr 09, 2014 11:11 am

purenoni wrote:What am I doing wrong? :roll:

I am trying to extract 3 fields fields from a website.

I am getting the script to extract everything OK, I just need to save the captured fields to one continually appending csv file.

I am using iMacros for Chrome. Thank you so much for your help!!

Code: Select all

VERSION BUILD=8810214 RECORDER=FX
TAB T=1
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=5
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=iosepa
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\teacher\Downloads FILE=heco.csv
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=5
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=kula
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\teacher\Downloads FILE=heco.csv
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=5
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=moana
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\teacher\Downloads FILE=heco.csv
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=5
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=puuahi
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\teacher\Downloads FILE=heco.csv
Ah-ah, nearly funny... :shock: "I am getting the script to extract everything OK..." => No, you don't extract anything (in iMacros Terminology), you only retrieve the Data by filling in 3 Search Fields and clicking on the Search Button, which displays then the Results on the Result Page but then you don't do anything with the retrieved Data in your Script...

"SAVEAS TYPE=EXTRACT" means that you are saving the Content of !EXTRACT which is filled by your selected Fields that you have extracted using TAG + EXTRACT. either you need to select the TABLE(s) or the individual Fields you want to extract and save (with "SAVEAS TYPE=EXTRACT" like you already try), or you can save the whole Page in one go with "SAVEAS TYPE=TXT" if you don't mind the extra Text around the 2 Tables on each Result Page.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
purenoni
Posts: 6
Joined: Wed Apr 09, 2014 4:20 am

Re: Can't save extracted data into a continuously appending

Post by purenoni » Sat Apr 12, 2014 6:18 am

Thank you for your quick reply. Do you mind pasting the code I need to make the script work properly using the "SAVEAS TYPE=TXT" command as you suggested?
chivracq
Posts: 9179
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can't save extracted data into a continuously appending

Post by chivracq » Sat Apr 12, 2014 1:34 pm

purenoni wrote:Thank you for your quick reply. Do you mind pasting the code I need to make the script work properly using the "SAVEAS TYPE=TXT" command as you suggested?
Hoody! Is it that complicated to replace "SAVEAS TYPE=EXTRACT" with "SAVEAS TYPE=TXT" in your Script...!?
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
purenoni
Posts: 6
Joined: Wed Apr 09, 2014 4:20 am

Re: Can't save extracted data into a continuously appending

Post by purenoni » Fri Apr 18, 2014 11:02 am

Sorry, but your last suggestion didn't save the text. Do you think you could enter the missing code that I need for the script and post it in a reply? If that doesn't work, is there some kind of control-printscrn command to capture all the scrolling text? Then I could copy and paste that captured text into a spreadsheet. Sorry to keep bothering you about this but I need this project done in 3 days. :(

VERSION BUILD=8810214 RECORDER=FX
TAB T=1
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=iosepa
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=lanihuli
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
chivracq
Posts: 9179
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can't save extracted data into a continuously appending

Post by chivracq » Sat Apr 19, 2014 9:37 am

Hum, 2nd time I find you (ironically) funny... "... need this project done in 3 days...", that means by Monday, sorry not much time this WE to dig into your Problem (again), you took 6 days to respond to my last msg... Maybe sbd else will look into it in the meantime... Bump it again otherwise beginning of coming week...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
purenoni
Posts: 6
Joined: Wed Apr 09, 2014 4:20 am

Re: Can't save extracted data into a continuously appending

Post by purenoni » Sun Apr 20, 2014 7:06 am

Hello once again. I realize you have already attempted to answer my question but I am not sure of the exact syntax to make the script work.

Right now my script just saves the text on the screen (see below), not the 5 columns of data that is generated by the 3 input fields.

Could you please correct my script so that it can capture and save just the 5 columns of data (table) that I am querying?

Thanks so much for your time. :)

I will use a bat script to append the multiple csv files into one file. i.e.: copy *.csv final-all-in-one.csv


VERSION BUILD=8810214 RECORDER=FX
TAB T=1
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=IOSEPA
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
SAVEAS TYPE=TXT FOLDER=C:\Users\teacher\Downloads FILE=heco6.csv


THE SCRIPT CURRENTLY SAVES THIS TEXT (instead of the 5 columns od data - which need to be defined in a table as you indicated):

CONTACT US
RESIDENTIALBUSINESSCLEAN ENERGYSAFETY AND EMERGENCYRECIPESCOMMUNITYEDUCATIONCAREERSABOUT US
Welcome to the Locational Value Map (LVM) for Oahu

Hawaiian Electric Company provides this Locational Value Map / Address Search Tool for informational purposes. It is designed to show customers and solar contractors an estimate of the level of distributed generation (DG) penetration on distribution circuits as a percentage for both minimum daytime and peak circuit loads at a given point in time.
Data shown in the maps and from the address search tool are updated nightly on weekdays. For more information about possible studies and upgrades, call or email the respective programs (SIA, NEM, FIT).
Click map to enlarge

This map shows circuits with installed PV up to and greater than 120% of daytime minimum load (DML)*. For systems up to 10 kW, an interconnection study will not be needed if total PV on the circuit is equal to or less than 120% of DML. However, upgrades may be necessary.
* For purposes of the map, daytime is defined as 9 a.m. to 5 p.m.
This map shows distributed generation (mostly solar photovoltaic or PV) on each circuit compared to 15% of peak electricity demand, or “load” on each circuit. It also shows levels beyond 15%.
 
Address Search Tool

Begin your address search** by entering the Street Name and one of the following: (1) Street Number or (2) Zip Code in the fields below.
Street Number starts with:
Street Name starts with:
Zip Code:
 
Rammsis
Posts: 17
Joined: Mon Apr 05, 2010 1:37 pm

Re: Can't save extracted data into a continuously appending

Post by Rammsis » Sun Apr 20, 2014 4:54 pm

Code: Select all

SET !EXTRACT_TEST_POPUP NO
TAB T=1
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=IOSEPA
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
TAG POS=1 TYPE=TD ATTR=ID:ID-LVMSearchResults2-Street-column-data-odd-row EXTRACT=TXT
TAG POS=1 TYPE=TD ATTR=ID:ID-LVMSearchResults2-StreetName-column-data-odd-row EXTRACT=TXT
TAG POS=1 TYPE=TD ATTR=ID:ID-LVMSearchResults2-CityStateZipCode-column-data-odd-row EXTRACT=TXT
TAG POS=1 TYPE=TD ATTR=ID:ID-LVMSearchResults2-PenRangeByCircuitDaytimeMin-column-data-odd-row EXTRACT=TXT
TAG POS=1 TYPE=TD ATTR=ID:ID-LVMSearchResults2-PenRangeByCircuitPeak-column-data-odd-row EXTRACT=TXT
SAVEAS TYPE=TXT FOLDER= * FILE=heco6.csv
you need a little bit edit your heco6.csv but this code at least extract something

Code: Select all

SAVEAS TYPE=TXT FOLDER= *
i maked this way because my folder is different then yours so imacros will recognize and put in correct folder
Rammsis
Posts: 17
Joined: Mon Apr 05, 2010 1:37 pm

Re: Can't save extracted data into a continuously appending

Post by Rammsis » Sun Apr 20, 2014 5:26 pm

or this one

Code: Select all

SET !EXTRACT_TEST_POPUP NO
TAB T=1
URL GOTO=http://www.heco.com/portal/site/heco/lvmsearch
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=
TAG POS=2 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=IOSEPA
TAG POS=3 TYPE=INPUT:TEXT ATTR=ID:ID-LVMSearch-control CONTENT=96762
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:ID-LVMSearch-Search-button
TAG POS=11 TYPE=TABLE ATTR=TXT:* EXTRACT=TXT
SAVEAS TYPE=TXT FOLDER= * FILE=heco6.csv
purenoni
Posts: 6
Joined: Wed Apr 09, 2014 4:20 am

Re: Can't save extracted data into a continuously appending

Post by purenoni » Sun Apr 20, 2014 6:21 pm

Thanks so much rammsis!! It WORKED! :D :D :D :D :D

You are a genius! I'm a day ahead of my deadline!
Post Reply