用Javascript修复imacros中断 [英] The fixing imacros interruption with Javascript

查看:102
本文介绍了用Javascript修复imacros中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在从网站上下载一些文件.由于需要数百万次点击的大量数据,我选择使用iMacros来完成点击.但是网站不稳定并且不时中断自动点击.我已经解决了一些问题,但仍然存在一个问题.

I am currently downloading some files from the website. Due to the large amount of data that requires millions of clicks, I choose to use iMacros to accomplished the clicks. But the website is unstable and interrupt the automatic click from time to time. I had it fix some of problems while there is still one problem remaining.

问题的屏幕截图

图片显示了问题所在.它只是停止而不会继续.它不会返回错误,而只是停止.

The Picture shows the problems. It just stops and do not proceed. It does not return with an error but just stops.

在每个特定行中,它们旨在单击按钮或填充某些上下文.有时网站响应缓慢,按钮或文本框未按时显示.因此,宏仅在此处停止.我惊讶地发现它没有返回错误,而只是停在那里.

In each specific line, they are designed to click at a button or to fill in some context. And sometimes the website is responding slowly and the button or the text frame do not show on time. Thus, the macros just stopped there. I was astonished to find that it is not return with a error but just stopped there.

我正在寻找一个解决方案,以便每当这样停止时,我都可以重新启动当前循环,并且不会错过当前行.

I am looking for a solution on this so that whenever it stops like this, I can restart the current looping and do not miss the current line.

以下是伊玛目的代码.供参考.我衷心感谢您能帮助我解决这个问题.谢谢!

The following is the code for imacros. FYI. I sincerely appreciate that if you could help me out with this. Thanks!

1   TAB OPEN
2   WAIT SECONDS=1
3   TAB T=2
4   WAIT SECONDS=1
5   
6   SET myLoop EVAL("if ('{{myLoop}}' == '__undefined__') ml = 1576; else if ('{{!EXTRACT}}' == '' || '{{!EXTRACT}}' == '#EANF#') ml = ml; else ml = ++ml; ml;")
7   SET !EXTRACT NULL
8   
9   SET !DATASOURCE ???(????).csv
10  SET !DATASOURCE_COLUMNS 2
11  SET !DATASOURCE_LINE {{myLoop}}
12  SET !EXTRACT_TEST_POPUP NO
13  SET !TIMEOUT_STEP 40
14  
15  SET !ERRORIGNORE YES
16  URL GOTO=http://202.39.224.50/FMS_Plic/#
17  WAIT SECONDS=5
18  TAG POS=1 TYPE=A ATTR=TXT:????
19  
20  TAG POS=1 TYPE=A ATTR=TXT:????
21  WAIT SECONDS=3
22  
23  FRAME F=2
24  TAG POS=1 TYPE=A ATTR=ID:ddlDC_Arrow
25  TAG POS=1 TYPE=LI ATTR=TXT:???(????)
26  
27  TAG POS=1 TYPE=LI ATTR=TXT:???(????)
28  WAIT SECONDS=3
29  
30  TAG POS=1 TYPE=A ATTR=ID:ddlCar_Arrow
31  TAG POS=1 TYPE=LI ATTR=TXT:{{!COL1}}
32  
33  TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form1 ATTR=ID:date1 CONTENT={{!COL2}}
34  
35  TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:form1 ATTR=ID:btnQuery
36  WAIT SECONDS=15
37  
38  TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:form1 ATTR=ID:Cexcel EXTRACT=TXT
39  TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:form1 ATTR=ID:Cexcel
40  WAIT SECONDS=60
41  
42  TAB CLOSE
43  WAIT SECONDS=1
44  SET !ERRORIGNORE NO

推荐答案

尝试通过以下方式修改myLoop变量:

Try to modify the myLoop variable in the following way:

SET myLoop EVAL("if ('{{myLoop}}' == '__undefined__') {try {ml = (confirm('CONTINUE FROM THE LOOP #' + ml + ' ?') ? ml : 1)} catch(e) {ml = 1;}} else if ('{{!EXTRACT}}' == '' || '{{!EXTRACT}}' == '#EANF#') ml = ml; else ml = ++ml; ml;")

(我想如上所述,宏停止的问题是"iMacros for Chrome"的错误.因此,我的下一个建议可能是使用"iMacros for Firefox"及其JavaScript脚本接口.)

(I suppose that the problem of macro stopping as you described above is a bug of 'iMacros for Chrome'. So my next suggestion may be to use 'iMacros for Firefox' and its JavaScript Scripting Interface instead.)

这篇关于用Javascript修复imacros中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆