Menu
  • HOME
  • TAGS

IMacros: How to use Prompt with javascript

javascript,prompt,imacros

var x='PROMPT \"Page\" '; document.getElementById("demo").innerHTML = x ; <p id="demo"></p> Check the code and adjust according to that...

IMACRO's Script open 2 new tabs with specific URL's

javascript,instagram,imacros

It seems that, the problem was that I need to SET !EXTRACT NULL before adding another value to it! That was the problem! VERSION BUILD=8881205 RECORDER=FX SET !ERRORIGNORE YES SET !EXTRACT_TEST_POPUP NO SET !TIMEOUT_STEP 2 TAB T=1 TAG POS={{!LOOP}} TYPE=A ATTR=CLASS:lienPhotoGrid&&HREF:#/detail/* EXTRACT=HREF TAB OPEN TAB T=2 URL GOTO={{!EXTRACT}} TAG POS=1...

How do I set the Select All “checkbox” iMacros Without using the button “Play (Loop)”

javascript,select,checkbox,imacros

Maybe this could help you: URL GOTO=javascript:{var<SP>chkBoxes=document.getElementsByName("category[]");for(i=0;i<chkBoxes.length;i++)chkBoxes[i].checked=true;undefined;} ...

iMacro Cannot download image generated by PHP

imacros

As a variant, replace your last line of code with: TAG POS=1 TYPE=IMG ATTR=ALT:resulting<SP>barcode CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT ...

How to access web page source code including CSS and JavaScript like chrome inspect element option does?

javascript,jsp,selenium,sap,imacros

you can do it with Test tools listed below: Apache JMeter. I ever used to test our BOE platform automatically(Login BOE, click folder, open document, refresh document...). It records your operation, and repeats the operations. PhantomJS. A headless browser, not a real browser. You can write Javascript to operate the...

Imacros unterminated regular expression literal

javascript,regex,imacros

I'm not sure what end result should be, but to fix the error you just need to escape the backslashes. Since it's being eval, you need to basically double-escape all backslashes: eval("var b='{{!extract}}'; var s = b.replace(/\\n\\s*\\n/g, '\\n'); s;") ...

How to highlight active row in excel and then return to base background color in VBA

excel-vba,user-controls,imacros

You can use your 'clear all' functionality before changing the color of the row of the cell that you navigated to. Open the VB Editor and right click --> view code on the worksheet that you want the row highlighting to take place. Paste in this code: Private Sub Worksheet_SelectionChange(ByVal...

How to target form input fields whose names are changing everytime after reloading page in iMacros?

javascript,php,html,css,imacros

Based on the JSFiddle and the image you showed, it looks like some of the inputs are hidden. You can use this code to grab the visible inputs: var isVisible=function(node){ return (node.offsetWidth && node.offSetWidth >0) || (node.offsetHeight && node.offsetHeight>0); }; var inputs=[].filter.call(document.querySelectorAll('input'),isVisible); var usernameInput=inputs[0]; var hoursInput=inputs[1]; console.log(usernameInput,hoursInput); The code logs...

“URL GOTO” keeps looping from iMacros javascript

javascript,loops,firefox,command-line,imacros

Use only one file "TodaysEvents.js". And let it be like this: const L = "\n"; iimPlayCode("TAB T=1" + L + "URL GOTO=http://www.event.com/schedual" + L); for (i = 1; i < 130; i++) { iimSet("loop", i); iimPlayCode("SET !ERRORIGNORE YES" + L + "TAG POS={{loop}} TYPE=A ATTR=TXT:02 EXTRACT=HTM" + L + "SAVEAS...

Traversing DOM in javascript [closed]

javascript,jquery,dom,imacros

for (var i = 1; i < 18; i++) { document.querySelector(".foo table > tbody > tr:nth-child(" + i + ") > .goo:nth-child(2) > a").click(); } ...

Can't read first row of CSV file

csv,vbscript,imacros

The Recordset object reads the first line of the CSV as the table headers, so the second line is the first data row. You can avoid this by using a driver that you can instruct not to do that: strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sDir & _ ";Extended Properties=""text;HDR=No;FMT=Delimited"";" or...

How to run Javascript in iMacros

javascript,imacros

Try this pseudo-URL: URL GOTO=javascript:{function<SP>pageScroll(){window.scrollBy(0,50);/*horizontal_and_vertical_scroll_increments*/scrolldelay=setTimeout("pageScroll()",100);/*scrolls_every_100_milliseconds*/}pageScroll();} ...

Loop Variable in GOTO iMacros

javascript,loops,imacros

Finally got it working!! TAB T=1 SET !LOOP 0 SET !VAR1 152429 ADD !VAR1 -{{!LOOP}} URL GOTO=javascript:gotoProductPage({{!VAR1}},'1') WAIT SECONDS=1 URL GOTO=http://localhost/guitar-sale-sample Above "Play (Loop)" in the Firefox extension, I defined the Max to 2000, so each time it loops its keeps on substracting x+1 to !VAR1, looping through the 2000...

Looping with Excel VBA and iMacros

vba,excel-vba,imacros

You haven't incremented the 'row' variable. You need to include "row = row + 1" right before "Loop", or if you really want to use the Activecell idea, you can put "row = ActiveCell.row" right before 'Loop' (although the other way makes more sense and will be faster) Even if...

imacro not taking 2nd url

csv,imacros

Try this: 1.Go back to home page of Google Analytics before script ends 2.And then let new url(2nd row data from excel sheet be called in URL GOTO={{!COL1}})...

Imacros how to make wilcard?

imacros

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 ...

Need solution regarding imacros !DATASOURCE_LINE issue

csv,macros,imacros

Use the command 'EVAL' and 'switch'-clause. As an example: ... SET !DATASOURCE tv-series.csv SET !DATASOURCE_LINE 1 SET lineNumber EVAL("switch ('{{!COL1}}') {case 'Game of Thrones': s = 2; break; case 'Something Else': s = 5; break; /* etc. */}") SET !DATASOURCE_LINE {{lineNumber}} ... ...

Using a csv file with imacros

javascript,imacros

Use double-slash: inputInfo += "SET !DATASOURCE E:\\example.csv" + "\n"; ...

“Document not defined” Javascript with IMacros

javascript,jquery,imacros

I've never been able to load jQuery into an imacros script, but that's not such a big deal in the end. To access the DOM you need to refer each element as: window.content.document.getElementsByClassName('foo') for example. This will give you an array so be sure to pick each of the elements...

iMacros 10 macro has stopped working after upgrade from iMacros 9

excel,vba,internet-explorer,excel-vba,imacros

I don't think the issue is in the code. As you've said, the code works fine and so the only thing that changed is the version of the browser and iMacro. An IE11 update possibly could have broken your macro: http://imacros.net/microsoft-update-for-ie11-kb3025390-breaks-tag-command-in-imacros-for-ie If you must use iMacros with IE11, another workaround...

iMacros how to remove GBP £ symbol from extracted variable

javascript,imacros

... SET !EXTRACT EVAL("var s=\"{{!EXTRACT}}\"; x=s.replace(\"£\",\"\"); x;") ' in order to see the extracted value use 'PROMPT'' PROMPT {{!EXTRACT}} SET !EXTRACT NULL ...

iMacro's !LOOP from command line

javascript,bash,loops,firefox,imacros

As Shugar pointed out, the only solution is to use javascript. The scripting interface the comes with iMacros Browser is different from the built in JavaScript interpreter in Firefox iMacros. The iMacros Browser only works on windows, so its a bummer for linux users, yet the Firefox add-on is universal....

iMacros: EVENT:FAIL_IF_FOUND on !URLCURRENT

imacros

You can use EVAL to emit exception: SET !VAR1 EVAL("/sorry/.test('{{!URLCURRENT}}') && MacroError('wrong page')") ...

How to save a variable javascript? [closed]

javascript,imacros

You can store the value in local storage localStorage.setItem("stopNumber", stopNumber); Retrieve it with stopNumber = parseInt(localStorage.getItem("stopNumber")); More info here http://www.w3schools.com/html/html5_webstorage.asp...

IMACROS search for specific user

loops,search,if-statement,extract,imacros

Comment your line SET !ERRORIGNORE YES

Form-filling iMacro keeps returning error

imacros

Remove the SET !LOOP 1 part. Then open the file and save it as UTF8 file and run it in iMacros....

just use second item from an array

javascript,imacros

Change the SET line to: SET !VAR1 EVAL("var s=\"{{!CLIPBOARD}}\"; s = s.split(\"(B)\"); var r = s[1];r ") split doesn't modify the string it is called from. Also, I removed the limit of 1 you passed in to the split method, because that will make it only return the first index...

iMacros TAG POS with XPATH

imacros

Question self-solved after changing "contact" and "about" to 'contact' and 'about' TAG XPATH="(/html/body//a[contains(@href,'contact') or contains(@href,'about')])[1]" ...

Running javascript from the “userside”

javascript,jquery,html,imacros

One way would be to use a 'bookmarklet'. Those are small javascript snippets, which you can insert into your bookmark bar and then execute by clicking on them. <a href="javascript:(function(){alert(1);})()">Drag me to bookmarks for alert</a> For Example, drag the link in this fiddle into your bookmark bar and it will...

Run iMacros in Firefox via Python

python,firefox,imacros

You can have 100% control over Firefox with Python, as both are open source. The trick is to figure out details. Here are some starting points Python can script Firefox with Selenium WebDriver With some tricks, you can dive deeper into Firefox what basic Selenium interaction offers, like opening a...

Scraping dynamic data with imacro to excell

web-scraping,imacros

Here is the more detailed answer with a code. TAG POS=1 TYPE=TD ATTR=CLASS:"score" EXTRACT=TXT SET !EXTRACT EVAL("'{{!EXTRACT}}'.match(/\\d+/)[0];") TAG POS=1 TYPE=TD ATTR=CLASS:"score part" EXTRACT=TXT SAVEAS TYPE=EXTRACT FOLDER=* FILE=scores.csv TAG POS=2 TYPE=TD ATTR=CLASS:"score" EXTRACT=TXT SET !EXTRACT EVAL("'{{!EXTRACT}}'.match(/\\d+/)[0];") TAG POS=2 TYPE=TD ATTR=CLASS:"score part" EXTRACT=TXT SAVEAS TYPE=EXTRACT FOLDER=* FILE=scores.csv WAIT SECONDS=4 Play this macro...

iMacros TAG to Find TXT and Click Nearby (previous) Link

javascript,dom,web-scraping,scrape,imacros

Relative positioning doesn't meet well this issue, so: SET !EXTRACT_TEST_POPUP NO TAG POS=1 TYPE=SPAN ATTR=TXT:*Banana* EXTRACT=HTM SET FP EVAL("parseInt('{{!EXTRACT}}'.match(/check-num-(\\d)/)[1]) + 1;") TAG POS={{FP}} TYPE=A ATTR=TXT:* ...

imacros don't show commas from csv file

imacros

You need to add quotes between the commas in your csv file. Below is an example Example: 0,123 -> "0","123" should work or you can change the delimiter from , to ; For that put following code before SET !DATASOURCE C:\Users\Sahil\Desktop\cloth.csv SET !DATASOURCE_DELIMITER ;...

Call out certain loop on Imacros?

imacros

SET longWait EVAL("('{{!LOOP}}' % 30 == 0) ? 120 : 0") WAIT SECONDS={{longWait}} ...

How to use this javascript code with eval or in a iim file?

javascript,eval,imacros

Without Eval there is no way to using javascript code inside iim file.

IMACROS how to do this with Regex supported in search function

regex,search,replace,imacros

Don’t waste your time with the built-in editor. Use more advanced ones: ‘Sublime Text’, ‘Notepad++’ etc. (The symbol of a line break (new line) is \n there.)

Imacros set custom WAIT SECONDS

javascript,imacros

It looks like you're trying to use 's' before you define it. var macroStart; macroStart ="CODE:"; macroStart +="SET !ERRORIGNORE YES" + "\n"; macroStart +="SET !TIMEOUT_TAG 1" + "\n"; macroStart +="SET !TIMEOUT_STEP 1" + "\n"; macroStart +="SET !TIMEOUT_PAGE 30" + "\n"; macroStart +=" SET !REPLAYSPEED FAST" + "\n"; macroStart +="SET !TIMEOUT_MACRO...

How to extract text by using imacros?

html,csv,extract,imacros

TAG POS=1 TYPE=A ATTR=HREF:link EXTRACT=TXT This should work....

Simulate the use of a website with a client [closed]

javascript,c#,web,simulation,imacros

If you want it for .net, then there is WatiN. Here is an example how to use it: public void SearchForWatiNOnGoogle() { using (var browser = new IE("http://www.google.com")) { browser.TextField(Find.ByName("q")).TypeText("WatiN"); browser.Button(Find.ByName("btnG")).Click(); bool contains = browser.ContainsText("WatiN"); } } p.s. You can also try Test Recorder for generating macros....