bzowk wrote:Good Afternoon -
I am trying to configure an iMacros job which will collect 2 numerical values from 4 web pages then save them into a CSV daily for import into a report. I've gotten it to mostly work except for one small issue which I need help with, please.
I used the wizard to browse to and select the values, choosing to "Add command" after each. Only the numbers were selected, but the "Extracted" box shows the labels next to the numbers as well. I continued to see what the output would be and once I ran the job, it created a CSV which included both the label and value. Below is a screenshot of just the value "28" selected, yet it shows "Consumed 28 28" in "Extracted." The resulting CSV for that is also ""Consumed 28"
The macro string which captures the data is below.
Code: Select all
TAG POS=1 TYPE=LABEL ATTR=ID:Consumed_label EXTRACT=TXT
I've looked through online help, but cannot figure out how to just get it to grab the numerical value. Any suggestions?
Bonus Question
Once I get this figured out, I will need to find a way to import all 8 extracted values into an existing Excel report. If anyone has any suggestions or links that would help, I'd really appreciate it.
Thank You!
Yeah, Time is always a relative Concept, your "afternoon" is "evening" already in Europe, ah-ah...!
FCIM...!
(Read my Sig...)
=> iMB v12.0.501, OS...?
Always mention your FCI clearly when you open a Thread, preferably at the complete beginning of your Post, rather then half hidden in the middle of some Screenshot, I usually don't read/answer otherwise...
Hum, and when posting Images/Screenshots, you can better upload them directly to the Forum, as all those Image Hosting Sites one day stop existing or go commercial or clean up their Servers from time to time and (older) Threads containing such Images end up a bit useless for other Users, with empty Image Containers...
>>>
But OK, to answer your Qt, I can't see the full Content of the 'HTML code' Box from your Screenshot, but it looks like this 'LABEL' Element contains one or more 'DIV' Elements inside it, possibly without ID and the Wizard selected at the 'LABEL' Level while you'd rather be interested at the 'DIV' Level.
You would then need to try to select/identify the 'DIV' that you only want.
If it can't be identified (reliably) easily, you might need (Double) 'Relative Positioning' using that 'LABEL' as Anchor.
Or using your current 'EXTRACT' Statement, you could use 'EVAL()' on that Extract to keep only the Data that you want.
Post the full (relevant) HTML Code or the URL to that Page or upload some HTML Saveas (zipped, Max 256Kb) to your Thread if you don't come out by yourself.
>>>
Concerning importing your 8 Values into your existing Excel Report, well, you have the iMacros 'SAVEAS' Command that would be able to save that Data into a '.TXT' or '.CSV' File, and will append the Data if the File already exists, and is not already opened in Excel at that moment, for a '.CSV' File for example, as Excel will put a Lock on it and iMacros won't be able to open the File and save the Data...
But that won't work if your Report is a "complex" Report and you want to add the Data into some specific Cell(s)/Column.
An Option could be if you can open (and edit) that Report from some Online Interface, through an Online Form, or as a GoogleSheet for example, that can be accessed from iMacros...
Or you can always open the '.TXT' or '.CSV' File from Excel or Notepad and Copy&Paste its Content into the Report or course, but that's not really an "automated" Solution, ah-ah...!
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...