Calling more than 1 SET! LOOP, imacros - imacros

hello I use this code to fill from CSV , imacros in firefox .
Hello , I'm using this code in imacros to draw 1 line of CSV and fill 1 website form.
VERSION BUILD=8530828 RECORDER=FX
SET !ERRORIGNORE YES
SET !DATASOURCE C:\22853.csv
SET !DATASOURCE_COLUMNS 1
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO=http://www.publianuncia.com/site/crearAnuncioMundoanuncio/22853
TAG POS=1 TYPE=SPAN ATTR=ID:titulo-22853
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:titulo-22853-inplaceeditor ATTR=NAME:value CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:titulo-22853-inplaceeditor ATTR=*
I call the first line of the CSV , to fill a web form.
what I want now and I can not do this, you call more than 1 line of CSV , to fill a web form.
I have 6 lines in the CSV and want to call 6 to fill only 1 web form.
Thank you

Multiply code or Play (LOOP) with MAX: 6

Related

Show dynamic days with Month Dates in a Oracle Apex Grid Heading

I want to update Interactive grid Column Heading Name dynamically in oracle apex on the basis of month selected from list.
For example I have selected August from Month LOV then the column heading should be display like this.
01/MON, 02/TUE, 03/WED .............. 28/SAT,29/SUN,30/MON.
Previous Research
Code: I try to CONCATENATE date like this.
---------------For First Column Heading-----------
SELECT '01'||' / '|| TO_CHAR(:P152_START_DATE,'DAY')
FROM DUAL;
---------------For First Column Heading-----------
SELECT '02'||' / '|| TO_CHAR(:P152_START_DATE+1,'DAY')
FROM DUAL;
This is the interactive grid having column heading from 01-Aug-2021 to 31-Aug-2021.
A column header supports substitutions, so this is one solution.
Create 31 page items P152_COL1 up to P152_COL31.
Set page item for each column heading using substitution syntax (example &P152_COL1. )
Create a page process to populate the column header page items
BEGIN
FOR r IN
(SELECT TO_CHAR(TRUNC(TO_DATE(:P152_START_DATE, 'DD-MON-YYYY'),'MM') + level - 1,'DD/DY') AS wd,
TO_DATE(:P152_START_DATE, 'DD-MON-YYYY') + level - 1 as dt,
level - 1 as rn
FROM dual CONNECT by level < 32)
LOOP
--only include the days of the selected month, else print "-"
IF TRUNC(r.dt,'MM') = TRUNC(TO_DATE(:P152_START_DATE, 'DD-MON-YYYY'),'MM') THEN
APEX_UTIL.SET_SESSION_STATE('P152_COL'||r.rn,r.wd);
ELSE
APEX_UTIL.SET_SESSION_STATE('P152_COL'||r.rn,'-');
END IF;
END LOOP;
END;
Note that I assumed date format DD-MON-YYYY for the P152_START_DATE page item - adjust as needed for your project

SAS PROC TEMPLATE TEXT BREAK LINES

My aim is to generate an fdf output due to SAS so I can import it into adobe.
Unfortunately, my proc template produced file "template.fdf" is just single row. However, I need a new line of code after every put statement. Is there a way to insert this?
Thank you in advance
PROC TEMPLATE;
DEFINE TAGSET template.FDF / STORE = SASUSER.TEMPLAT;
DEFINE EVENT DOC_BODY;
START:
put "%FDF-1.2 "; <=== new breakline in the document
PUT "text"; <=== new breakline in the document
put "<</Root 1 0 R>> ";<=== new breakline in the document
FINISH:
PUT "%%EOF";
END;END;
RUN;
FILENAME OUT "C:\..\template.FDF";
ODS LISTING CLOSE;
ODS MARKUP BODY = OUT
TAGSET = template.FDF;
ODS MARKUP CLOSE; ODS LISTING;
NL option on PUT statement
put "%FDF-1.2 " nl;
From example 3
TEMPLATE Procedure: Creating Markup Language Tagsets

iMacros to extract google Link

I have a query in imacro
I have this code
SET !TIMEOUT_STEP 0
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !DATASOURCE GoogleExtract.csv
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=https://www.google.com/?gws_rd=ssl
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:f ATTR=NAME:q CONTENT={{!COL1}}
TAG POS=1 TYPE=BUTTON:SUBMIT FORM=NAME:f ATTR=NAME:btnG
WAIT SECONDS=10
TAG POS=1 TYPE=H3 ATTR=CLASS:"r" EXTRACT=HTM
SET !EXTRACT EVAL("'{{!EXTRACT}}'.match(/a href=\"(.*)\" onmousedown=/)[1];")
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\Chirag_Guru99\Documents\iMacros\Datasources FILE=GoogleExtractLinks.csv
I want to extract all google search results links in one excel file
But right now
I have code which extract only first link

SAS insert text into email body

This is the original code.
filename outmail email type='text/html'
subject='see this'
from="..."
to="..."
attach=("\...\a.pdf"content_type="application/pdf");
ods _all_ close;
ods listing close;
ods html body=outmail style=minimal;
title1 'AAA';
title2 'BBB';
proc tabulate data=
...
run;
ods html close;
ods listing;
But now I don't want to show a tabulated output in the email body, so I remove this part from the original code.
proc tabulate data=
...
run;
The problem is I won't have titles in the email any more. It seems I have to put some proc in the code to make titles exist in the email. But I don't want to show anything in the email body except
Hi all,
Regards,
Balala
Update
I tried this but no luck.
filename outmail email type='text'
subject="AAAA"
from="..."
to="..."
attach=("\\...\text.pdf" content_type="application/pdf");
data _null_;
file outmail;
put 'Hi all,';
put 'First line';
put 'Second line ';
put ' ';
put 'Regards,';
put 'Balala';
run;
But in the email, it shows Hi all,First lineSecond line Regards,Balala.
Update2
The 2nd option doesn't work for me.
1st option doesn't work at first, but when I restart SAS session, it works. But I haven't changed any setting.
And interestingly, I change the type to text/plain instead of text or text/html then everything works fine
You have two options there.
Options 1: HTML tags
Specify HTML tags in your email if you are doing content_type="text/html"
Example:
filename mailbox email 'me#example.com' subject='test email' content_type="text/html";
data _null_;
file mailbox;
put "<body>";
put "<p>Hello,</p>" ;
put "<p>Test email sent <br> Regards,</p>" /
'Automated SAS Code';
put "</body>";
RUN;
Options 2 "Backslash" pointer:
Specify backslash at the end of the line to make the pointer to go over the line. Beware of what Quentin pointed in the comments, you could end up with double lines. Depends on the your SAS platform and email server. Documented here (search for in the document "/"): http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000161869.htm
filename mailbox email 'me#example.com' subject='test email';
data _null_;
file mailbox;
put "Hello," /;
put "Test email sent. "/;
put "Regards," /;
put "Automated SAS Code";
RUN;
Regards,
Vasilij

Using iMacros to extract multiple combinations of a form to a CSV file

I'm brand new to iMacros, but I found the tool for a very specific use. However, I'm having trouble where to start..I think I'm a bit overwhelmed. Below is what I'd like to do, and I'll annotate it in English to explain the tasks, that I believe should be easy with the software..Any help in the right direction would be wonderful.
There are a lot of similar questions but like I said I'm brand new to the software and I imagine this should be straight-forward. Thanks!
VERSION BUILD=9002379
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=http://www.designashirt.com/QuickQuote.aspx
TAG POS=1 TYPE=SELECT FORM=ACTION:QuickQuote.aspx ATTR=NAME:listCategory CONTENT=%5
TAG POS=1 TYPE=SELECT FORM=ACTION:QuickQuote.aspx ATTR=NAME:listType CONTENT=%27
TAG POS=1 TYPE=SELECT FORM=ACTION:QuickQuote.aspx ATTR=NAME:listProduct CONTENT=%31
TAG POS=1 TYPE=INPUT:IMAGE FORM=ACTION:QuickQuote.aspx ATTR=NAME:rptColors$ctl00$imgColorSwatch
'listFrontColors should cycle from 1 - 7
TAG POS=1 TYPE=SELECT FORM=ACTION:QuickQuote.aspx ATTR=NAME:listFrontColors CONTENT=%1
'listBackColors should cycle from 0 - 7
TAG POS=1 TYPE=SELECT FORM=ACTION:QuickQuote.aspx ATTR=NAME:listBackColors CONTENT=%0
TAG POS=1 TYPE=DIV FORM=ACTION:QuickQuote.aspx ATTR=ID:step3
'This input field should cycle from 6 - 300
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:QuickQuote.aspx ATTR=NAME:rptAdultSizes$ctl02$sizeBox$txtQuantity CONTENT=6
TAG POS=1 TYPE=DIV FORM=ACTION:QuickQuote.aspx ATTR=TXT:Hanes<SP>Tagless<SP>Tee<SP>DescriptionIt<SP>is<SP>easy<SP>to<SP>understand<SP>why<SP>Hanes<SP>is<SP>a<SP>go-to<SP>bran*
TAG POS=1 TYPE=SELECT FORM=ACTION:QuickQuote.aspx ATTR=NAME:ddPrintType CONTENT=%SCRN
'This field is what needs to be extracted to a CSV file along with the listFrontColors & listBackColors & txtQuantity. example:
' Front Back Price
'6 1 0 $15.94
'7 1 0 $15.xx
'...
'300 1 0 $xx.xx
TAG POS=1 TYPE=TD FORM=ACTION:QuickQuote.aspx ATTR=TXT:$15.94
So far, I have:
VERSION BUILD=9002379
TAB T=1
TAB CLOSEALLOTHERS
SET VAR1 {{LOOP1}}
ADD VAR1 +1
URL GOTO=http://www.designashirt.com/QuickQuote.aspx
TAG POS=1 TYPE=SELECT FORM=ACTION:QuickQuote.aspx ATTR=NAME:listCategory CONTENT=%5
TAG POS=1 TYPE=SELECT FORM=ACTION:QuickQuote.aspx ATTR=NAME:listType CONTENT=%27
TAG POS=1 TYPE=SELECT FORM=ACTION:QuickQuote.aspx ATTR=NAME:listProduct CONTENT=%31
TAG POS=1 TYPE=INPUT:IMAGE FORM=ACTION:QuickQuote.aspx ATTR=NAME:rptColors$ctl00$imgColorSwatch
TAG POS=1 TYPE=SELECT FORM=ACTION:QuickQuote.aspx ATTR=NAME:listFrontColors CONTENT=%1
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:QuickQuote.aspx ATTR=NAME:rptAdultSizes$ctl02$sizeBox$txtQuantity CONTENT={{!LOOP}}
TAG POS=1 TYPE=SELECT FORM=ACTION:QuickQuote.aspx ATTR=NAME:ddPrintType CONTENT=%SCRN
'POS=1 TYPE=TD FORM=ACTION:QuickQuote.aspx ATTR=TXT:$15.94
TAG POS=1 TYPE=DIV FORM=ACTION:QuickQuote.aspx ATTR=ID:quick-quote
TAG POS=17 TYPE=TD FORM=ACTION:QuickQuote.aspx ATTR=* EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\Jeff\ FILE=test.csv
Currently the output looks like this:
$0.00
$0.00
$0.00
$0.00
$0.00
$15.94
$14.59
$13.58
$12.80
$12.17
$11.66
$0.00
$0.00
$0.00
I'm not sure why this breaks where 12 would be the number, but it does. If I can't automate the rest, I'd be fine with just editing this script and doing it ~90 times, still way easier, but not ideal.