Imacros Browser Crash when Loop

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
petrull
Posts: 3
Joined: Wed Apr 03, 2019 8:51 am

Imacros Browser Crash when Loop

Post by petrull » Mon Feb 24, 2020 9:19 am

Imacros Browser Crash when loop

Hello!

I have made a script that loops through the Products on the zalando page, scrapes the prices and some parameters of value. the script works fine but after 10-20 loops the browser crashes. I have tryed all the configurations i could find to sort the problem but nothing have solved the problem so far. please help! similar scripts on other sites work fine for 100+ loops.

--------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------
Script:
VERSION BUILD=12.0.501.6698
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 1
TAB T=1
SET !MARKOBJECT NO
FILTER TYPE=IMAGES STATUS=ON
TAB CLOSEALLOTHERS
'SET !PLAYBACKDELAY 0.00


SET start {{!URLCURRENT}}
SET hemsida https://www.zalando.se/man-skor-sneakers/
set !EXTRACT EVAL("var x=\"{{start}}\";var y=\"{{hemsida}}\"; if (x==y){x=\"\";} else {x=y;};")
SET URL {{!EXTRACT}}
SET !EXTRACT NULL
URL GOTO={{URL}}

TAG POS=1 TYPE=z-grid ATTR=CLASS:"cat_catarticles*"
TAG POS=R{{!LOOP}} TYPE=a ATTR=CLASS:"cat_image*" EXTRACT=href
set prod {{!EXTRACT}}
SET !EXTRACT NULL

TAB OPEN
TAB T=2
URL GOTO={{prod}}

'var1 Artikelnummer
TAG POS=1 TYPE=DIV ATTR=class:"h-container*"
TAG POS=R1 TYPE=SPAN ATTR=TXT:Artikelnummer*
TAG POS=R1 TYPE=SPAN ATTR=class:"h-text*" EXTRACT=TXT

SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL
'SET !TIMEOUT_STEP 0

'var2 yttermatieral
TAG POS=1 TYPE=DIV ATTR=class:"h-container*"
TAG POS=R1 TYPE=SPAN ATTR=TXT:Yttermaterial*
TAG POS=R1 TYPE=SPAN ATTR=class:"h-text*" EXTRACT=TXT

SET !VAR2 {{!EXTRACT}}
SET !EXTRACT NULL


'var3 Foder
TAG POS=1 TYPE=DIV ATTR=class:"h-container*"
TAG POS=R1 TYPE=SPAN ATTR=TXT:Foder*
TAG POS=R1 TYPE=SPAN ATTR=class:"h-text*" EXTRACT=TXT

SET !VAR3 {{!EXTRACT}}
SET !EXTRACT NULL

'var4 Innersula
TAG POS=1 TYPE=DIV ATTR=class:"h-container*"
TAG POS=R1 TYPE=SPAN ATTR=TXT:Innersula*
TAG POS=R1 TYPE=SPAN ATTR=class:"h-text*" EXTRACT=TXT

SET !VAR4 {{!EXTRACT}}
SET !EXTRACT NULL

'var5 Sula
TAG POS=1 TYPE=DIV ATTR=class:"h-container*"
TAG POS=R1 TYPE=SPAN ATTR=TXT:Sula*
TAG POS=R1 TYPE=SPAN ATTR=class:"h-text*" EXTRACT=TXT

SET !VAR5 {{!EXTRACT}}
SET !EXTRACT NULL

'var6 Fodertjocklek
TAG POS=1 TYPE=DIV ATTR=class:"h-container*"
TAG POS=R1 TYPE=SPAN ATTR=TXT:Fodertjocklek*
TAG POS=R1 TYPE=SPAN ATTR=class:"h-text*" EXTRACT=TXT

SET !VAR6 {{!EXTRACT}}
SET !EXTRACT NULL

'var7 Tyg
TAG POS=1 TYPE=DIV ATTR=class:"h-container*"
TAG POS=R1 TYPE=SPAN ATTR=TXT:Tyg*
TAG POS=R1 TYPE=SPAN ATTR=class:"h-text*" EXTRACT=TXT

SET !VAR7 {{!EXTRACT}}
SET !EXTRACT NULL

'var8 Tå
TAG POS=1 TYPE=DIV ATTR=class:"h-container*"
TAG POS=R1 TYPE=SPAN ATTR=TXT:Tå*
TAG POS=R1 TYPE=SPAN ATTR=class:"h-text*" EXTRACT=TXT

SET !VAR8 {{!EXTRACT}}
SET !EXTRACT NULL

'var9 Stängning
TAG POS=1 TYPE=DIV ATTR=class:"h-container*"
TAG POS=R1 TYPE=SPAN ATTR=TXT:Stängning*
TAG POS=R1 TYPE=SPAN ATTR=class:"h-text*" EXTRACT=TXT

SET !VAR9 {{!EXTRACT}}
SET !EXTRACT NULL

'var10 Mönster
TAG POS=1 TYPE=DIV ATTR=class:"h-container*"
TAG POS=R1 TYPE=SPAN ATTR=TXT:Mönster*
TAG POS=R1 TYPE=SPAN ATTR=class:"h-text*" EXTRACT=TXT

SET !VAR0 {{!EXTRACT}}
SET !EXTRACT NULL

'var11 Detaljer
TAG POS=1 TYPE=DIV ATTR=class:"h-container*"
TAG POS=R1 TYPE=SPAN ATTR=TXT:Detaljer*
TAG POS=R1 TYPE=SPAN ATTR=class:"h-text*" EXTRACT=TXT

SET var11 {{!EXTRACT}}
SET !EXTRACT NULL

'var12 Pris
TAG POS=1 TYPE=DIV ATTR=CLASS:"auWjdQ*"
TAG POS=R1 TYPE=DIV ATTR=CLASS:"WbSD97*" EXTRACT=TXT
SET !EXTRACT EVAL("var x=\"{{!EXTRACT}}\"; x=x.substring(0,x.indexOf(\",\"));")
SET !EXTRACT EVAL("var x=\"{{!EXTRACT}}\"; x=x.replace(/\\D/g,\"\");")

SET var12 {{!EXTRACT}}
SET !EXTRACT NULL

'PAR13 URL
SET var13 {{!URLCURRENT}}


ADD !EXTRACT {{!VAR1}}
ADD !EXTRACT {{!VAR2}}
ADD !EXTRACT {{!VAR3}}
ADD !EXTRACT {{!VAR4}}
ADD !EXTRACT {{!VAR5}}
ADD !EXTRACT {{!VAR6}}
ADD !EXTRACT {{!VAR7}}
ADD !EXTRACT {{!VAR8}}
ADD !EXTRACT {{!VAR9}}
ADD !EXTRACT {{!VAR0}}
ADD !EXTRACT {{var11}}
ADD !EXTRACT {{var12}}
ADD !EXTRACT {{var13}}


TAB CLOSE
TAB T=1

--------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------



What version of iMacros are you using?
12.0.501.6698 Enterprise Edition

What operating system are you using? (please also specify language)
Windows 10 Swedish

Which browser(s) are you using? (include version numbers)
Imacros Browser V12.5.503.8802

Do the included demo macros work ok?
Yes

If recording or replay fails on a specific website: Can you please post the URL of the web page and/or the macro that creates the problem?
https://www.zalando.se/man-home/

Do you encounter the same problem recording or replaying the macro in different browsers, such as the iMacros browser, Firefox, Chrome, or Internet Explorer?
The script does not run on plugins on firefox and chrome because relative positioning does not work the same as in the imacros browser.
Tom, Tech Support
Posts: 3711
Joined: Mon May 31, 2010 4:59 pm

Re: Imacros Browser Crash when Loop

Post by Tom, Tech Support » Mon Mar 23, 2020 5:21 pm

Hi petrull,

Some websites perform so poorly in IE (and hence also the iMacros browser), that the only way to work around issues like this is to frequently restart the browser, or just use a different browser. Zalando is one such site (UPS.com is another one that comes to mind).

I setup your macro to loop 30 times in the iMacros browser and the performance rapidly declined and then it crashed on me after 25 iterations. However, I then wrote a short VBScript to loop your macro 30 times and automatically restart the browser after every 5th iteration. When I ran it this way, there was no slow down in performance and it completed without any crash.

Since you already have the Enterprise Edition, you can also make use of the iMacros scripting interface to do the same by following the guidance in this wiki article.
Regards,

Tom, iMacros Support
Post Reply