使用selenium IDE提取文本的一部分并将其放入变量中 [英] Extract part of a text with selenium IDE and put it into variable
本文介绍了使用selenium IDE提取文本的一部分并将其放入变量中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以告诉我应该使用哪个命令从文本中仅使用Selenium Ide提取数字(694575)并将其放入变量以供进一步使用。
以下是包含文字的div:
Could somebody tell me which command should I use to extract only the number(694575) from the text using Selenium Ide and to put it into a variable for further usage. Here is the div with the text:
<div class="loginBoxTitle">Edit Exhibition Centre - 694575, Exhibition Center1</div>
可能是像storeText这样的命令,storeEval应该适用于这种情况,但带有pasrsing的部分是对我来说是个痴迷。
May be commands like storeText,storeEval should work in this case ,but the part with the pasrsing is a mistery for me.
推荐答案
我有解决方案,很棘手1
I have solution, tricky 1
store | Edit Exhibition Centre - 694575, Exhibition Center1 | string
store | 1 | delimiter
store | javascript{storedVars['string'].split('- ')[storedVars['delimiter']]} | test
store | 0 | delimiter1
store | javascript{storedVars['test'].split(',')[storedVars['delimiter1']]} | output
echo | ${output}
试试这个1,让我知道它是否适合你
Try this 1, and let me know whether its working for you
这篇关于使用selenium IDE提取文本的一部分并将其放入变量中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文