iMacro, how to set variables from selected text? - imacros

It's a framed site, and the TAG command created when I highlight the text is:
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:TEST<SP>TEST
I'm trying to figure out how to extract the TEST<SP>TEST part and set it to a variable, so I can put it in a form on another tab.

try this:
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:TESTTEST extract=txt

Related

iMacros Extract DATA from Input Text

I want to extract data from an input Text through iMacros. Here is my code:
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:timeentry_total CONTENT=60
I tried using:
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:timeentry_total EXTRACT:TXT
This gives me 'wrong format' error.
What should I do?
Thanks
Fahad
Please change the format to
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:timeentry_total EXTRACT=TXT
Instead of
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:timeentry_total EXTRACT:TXT
As you can see, the only difference is that you are using : instead of = which is causing the issue!

How to Make iMacros Run Data Entry Script for 100's of CSV's?

I have a script that will run the same exact process (pasting a list from a CSV into a text box), many times on the same web page, and I'm trying to get it to run the process one time for many CSV's in the working folder (1.csv, 2.csv, 3.csv,... 100.csv, etc).
Is it possible for iMacros to loop through the same script, only varying the input file (!DATASOURCE)?
I will name the CSV's numerically so the script can cycle through them easily.
Link to sample CSV (note: all keywords put into 1 cell so that it can be pasted as a list, one per line).
Example of how each CSV file's contents will be pasted as a list (one keyword per line):
I am new to iMacros and was hoping this would work, but it stops running on the 2nd loop, and throws the error:
TypeError: this.dataSource[(line - 1)] is undefined, line 14 (Error code: -1001)
Here is the code I have so far:
VERSION BUILD=8961227 RECORDER=FX
TAB T=1
SET !DATASOURCE {{!LOOP}}.csv
URL GOTO=https://sellercentral.amazon.com/hz/cm/adgroup/create?campaignId=A0478490D2AQYA9C8NTW
TAG POS=1 TYPE=DIV ATTR=ID:product-search-results
TAG POS=1 TYPE=INPUT:SEARCH FORM=ID:form-ad-group ATTR=ID:product-search-input CONTENT=product<SP>name
TAG POS=1 TYPE=BUTTON FORM=ID:form-ad-group ATTR=ID:product-search-button
TAG POS=1 TYPE=BUTTON FORM=ID:form-ad-group ATTR=TXT:Select
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form-ad-group ATTR=ID:txt-starting-bid CONTENT=1.25
TAG POS=1 TYPE=A ATTR=ID:tool-kw-ui-manual
TAG POS=1 TYPE=TEXTAREA FORM=ID:form-ad-group ATTR=ID:txt-keywords CONTENT={{!COL1}}
TAG POS=1 TYPE=DIV ATTR=TXT:Add<SP>these<SP>keywordsSaving...
Note:
I'm trying to automate data entry of a list, and since the data needed to be pasted one keyword per line, I had to save my list with notepad as a .csv and put quotation marks before the first keyword, and after the last keyword, so iMacros would recognize it as just 1 cell.
Just realized my approach was valid, just didn't realize I had to put the SET !DATASOURCE_LINE 1 after SET !DATASOURCE {{!LOOP}}.csv
The working code I have now looks like this:
VERSION BUILD=8961227 RECORDER=FX
TAB T=1
SET !DATASOURCE {{!LOOP}}.csv
SET !DATASOURCE_LINE 1
URL GOTO=https://sellercentral.amazon.com/hz/cm/adgroup/create?campaignId=A0478490D2AQYA9C8NTW
TAG POS=1 TYPE=DIV ATTR=ID:product-search-results
TAG POS=1 TYPE=INPUT:SEARCH FORM=ID:form-ad-group ATTR=ID:product-search-input CONTENT=product<SP>name
TAG POS=1 TYPE=BUTTON FORM=ID:form-ad-group ATTR=ID:product-search-button
TAG POS=1 TYPE=BUTTON FORM=ID:form-ad-group ATTR=TXT:Select
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form-ad-group ATTR=ID:txt-starting-bid CONTENT=1.25
TAG POS=1 TYPE=A ATTR=ID:tool-kw-ui-manual
TAG POS=1 TYPE=TEXTAREA FORM=ID:form-ad-group ATTR=ID:txt-keywords CONTENT={{!COL1}}
TAG POS=1 TYPE=DIV ATTR=TXT:Add<SP>these<SP>keywordsSaving...

Imacros how to make wilcard?

I am beginning user of imacros for firefox,
I have all updated, and tried to record this macro to load next page.
In one instance next page link is:
TAG POS=1, in another TAG POS=2.
I tried to use wildcard * instead of number 1 or 2, but didn't work.
What is a way to make wildcard, so imacros can click the link regardless is it TAG POS=1 or TAG POS=2?
Probably, this could help you (but without a wildcard):
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
TAG POS=1 ...
TAG POS=2 ...
SET !ERRORIGNORE NO
SET !TIMEOUT_STEP 6
This is possible.
Use a different identifier for what iMacros needs to click on:
TAG POS=1 TYPE=A ATTR=TXT:Button*
Explanation from documentation:
Tag line as recorded by iMacros:
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/kb/ki.dll/ke.kb.gz?kbb;532452&&2&&&&&nc ATTR=NAME:zipcode CONTENT=85250
If you record the same macro a second time you will see that we get the same TAG line except one number - this is the session ID the website is using.
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/kb/ki.dll/ke.kb.gz?kbb;532244&&2&&&&&nc ATTR=NAME:zipcode CONTENT=85250
Replace the session ID with *:
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/kb/ki.dll/ke.kb.gz?kbb;*&&2&&&&&nc ATTR=NAME:zipcode CONTENT=85250
Actually, you could also remove most or all of the static parts of the FORM information as well. Exactly how much you can remove depends on the website. You still need enough information for iMacros to uniquely identify the page element. In our example, the result looks like:
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/kb/* ATTR=NAME:zipcode CONTENT=85250
or even
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:* ATTR=NAME:zipcode CONTENT=85250
Note: TXT:* is not the same as TXT: (without ). If only TXT: is used, this means you are looking for an element where the text attribute is "", if you are using TXT: this means that the text attribute can have any value (= same as omitting the text attribute altogether). This applies to any attribute, not just TXT.
Sources:
http://wiki.imacros.net/Form_Filling#Wildcards
http://forum.imacros.net/viewtopic.php?t=11663

Imacros: How to select from dropdown menu which is without the "content tag"

Normally when selecting an option from dropdown menu, the recorded macro look somewhat like this
TAG POS=1 TYPE=SELECT FORM=NAME:prod ATTR=NAME:variantID_4 CONTENT=%234
But a website gives me this code for dropdown menu
TAG POS=1 TYPE=LI FORM=ID:enterNewOfferForm ATTR=ID:conditionSelect_chzn_o_3
There is no CONTENT tag. As a result when I play the macro, it does not select anything from the dropdown menu.
Here is the full code
VERSION BUILD=10022823
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=website/enterNewOffer.php
TAG POS=1 TYPE=TEXTAREA:TEXT FORM=ID:enterNewOfferForm ATTR=NAME:artex2Input CONTENT=Description
TAG POS=4 TYPE=INPUT:TEXT FORM=ID:enterNewOfferForm ATTR=*
TAG POS=1 TYPE=LI FORM=ID:enterNewOfferForm ATTR=ID:conditionSelect_chzn_o_3
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:enterNewOfferForm ATTR=NAME:taxInput CONTENT=2<SP>dollar
I tried many variations of the code but no success
Please pay the attention that you need to get a value of select tag, not of some li item.
It means that you need to use TYPE=SELECT (not TYPE=LI).
TAG POS=1 TYPE=SELECT FORM=ID:enterNewOfferForm ATTR=ID:conditionSelect_chzn_o_3
in the case if for some reason you really need to get a value of all options (li), you can extract them for future processing:
VERSION BUILD=1005 RECORDER=CR
SET !EXTRACT_TEST_POPUP NO
SET !EXTRACT NULL
TAG POS=1 TYPE=SELECT FORM=ID:enterNewOfferForm ATTR=ID:conditionSelect_chzn_o_3 EXTRACT=TXTALL
PROMPT {{!EXTRACT}}

iMacros loop based search and extract result

I am trying to build a macro that automatically search a Keyword from a CSV file and paste it in a search box then click on search button, when search result comes up then click on that result.So far I can go maximum click on search button and bring search result but I can't do later. Now What command should I put that macro so it clicks on the search result. Please see below images
Below is the code I am using:
VERSION BUILD=8810214 RECORDER=FX
TAB T=1
SET !DATASOURCE Extracts.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
SET !Extract_TEST_POPUP NO
URL GOTO=https://reports.zoho.com/ZDBDataSheetView.cc?DBID=302139000000984683
TAG POS=1 TYPE=DIV ATTR=ID:ZDBMainBox
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ZDBObjSearchTxtFld CONTENT= {{!COL1}}
wait seconds = 3
TAG POS=131 TYPE=DIV ATTR=TXT:
TAG POS=1 TYPE=A ATTR=ID:{{!COL1}}
Can anyone please help me to figure out the right command?
VERSION BUILD=8810214 RECORDER=FX
TAB T=1
SET !DATASOURCE Extracts.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
SET !Extract_TEST_POPUP NO
URL GOTO=https://reports.zoho.com/ZDBDataSheetView.cc?DBID=302139000000984683
TAG POS=1 TYPE=DIV ATTR=ID:ZDBMainBox
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:ZDBObjSearchTxtFld CONTENT={{!COL1}}
wait seconds = 3
TAG POS=131 TYPE=DIV ATTR=TXT:
TAG POS=1 TYPE=A ATTR=TXT:*{{!COL1}}*
I tried this code and it worked. I replaced the ID with TXT in last line of the code.