iMacros for Chrome:如果发生错误如何重播宏?
我有这个简单的 3 行宏来加载表单并提交,有时我收到此消息“RuntimeError:未找到 TXT 指定的元素 SPAN:提交未找到,行:3”如何自动重播宏?我想重播宏,直到提交表单。我正在使用 iMacros for Chrome 版本 10.1.1,谢谢。
SET !TIMEOUT_STEP 0
URL GOTO=https://docs.google.com/forms/......
TAG POS=2 TYPE=SPAN ATTR=TXT:Submit
I have this simple 3 line macro to load a form and submit, sometime I get this "RuntimeError: element SPAN specified by TXT:Submit was not found, line: 3" how can I auto replay the macro? I would like to replay the macro until the form is submitted. I am using iMacros for Chrome Version 10.1.1, thank you.
SET !TIMEOUT_STEP 0
URL GOTO=https://docs.google.com/forms/......
TAG POS=2 TYPE=SPAN ATTR=TXT:Submit
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,好吧...,您的
!TIMEOUT_STEP
(=0) 是“问题(部分)”...!“Google”文档/表单“已知”是相当“重”的页面,需要“一些时间”来加载(特别是如果您是文档/表单的所有者/编辑者),甚至当浏览器“思考”时页面已完全加载(并告诉 iMacros(在
URl GOTO
之后),=>“继续,页面已加载,您可以继续执行脚本的其余部分”...) , 有在“提交”按钮出现或激活之前,页面/字段上可能还有一些后台 JS 验证(必填字段、数据格式等...)...为
!TIMEOUT_STEP
, =>;至少 =1,但 =3 或默认 =6 也可以,并且比您的 =0 更“可靠”...和/或,添加一个迷你
WAIT
语句在URL GOTO
之后。和/或,在脚本开头或至少在
URL GOTO
之后添加一个迷你!PLAYBACKDELAY
语句。...其他技术也可用于“提高可靠性”(=> 在激活
!ERRORIGNORE
的情况下循环脚本,并有条件地中止它(使用EXTRACT
+EVAL ()
+MacroError()
) 成功后,有条件地设置我提到的任何“超时”选项,并在单击后提取“结果”在“提交”按钮上等等...),但它们都会与您的!TIMEOUT_STEP
=0 进行“战斗”,因为它太短了...Yeah, well..., your
!TIMEOUT_STEP
(=0) is "(part of) the problem"...!'Google' Docs/Forms are "known" to be pretty "heavy" Pages that take "some time" to load, (especially if you are the Owner/Editor of the Doc/Form), and even when the Browser "thinks" that the Page has fully loaded (and tells iMacros (after the
URl GOTO
), => "Go on, the Page has loaded, you can proceed with the rest of the Script"...), there is probably still some background JS Validation on the Page/Fields (Required Fields, Data Formatting, etc...), before that 'Submit' Button will appear or get Activated...Use a longer Setting/Value for
!TIMEOUT_STEP
, => at least =1, but =3 or the Default =6 would also be OK and much more "reliable" than your =0...And/or, add a mini-
WAIT
Statement after theURL GOTO
.And/or, add a mini-
!PLAYBACKDELAY
Statement at the beginning of the Sccript, or at least after theURL GOTO
.... Other Techniques are also available to "increase Reliability" (=> loop the Script with
!ERRORIGNORE
activated and conditionally abort it (withEXTRACT
+EVAL()
+MacroError()
) when successful, set any of the 'Timeout' Options I mention conditionally, combined with extracting the "Result" after clicking on the 'Submit' Button, etc...), but they will all be "fighting" against your!TIMEOUT_STEP
=0 which is too short...