Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
339 views
in Technique[技术] by (71.8m points)

javascript - 如果出现文本,请停止单击[关闭](Stop Clicking if a text Appears [closed])

I So i have a auto Click Script But i want him to Stop Clicking if a text Appears Lets say the text is (agx)(我所以我有一个自动的Click脚本,但是如果要显示一个文本,我希望他停止单击。可以说该文本是(agx))

what i have is document.getElementsByName('save')[0].click();(我所拥有的是document.getElementsByName('save')[0].click();) Please Help im new to this(请帮助我新)   ask by AJX translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Where the text should appear?(文字应出现在哪里?)

You can add an if statement inside your auto click script that exit yoir code.(您可以在自动点击脚本中添加if语句,以退出您的代码。) Maybe you can show us a little more.(也许您可以向我们展示更多。) Anyway, it should be something like this(无论如何,应该是这样的) yourAutoFunction(){ let exit = false; while(!exit){ if(textagxAppears){ exit=true; }else{ //run your automation script here } } }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...