Hi!
I have a problem. I need to extract text from different tags on the page (tags name could be random, so I can’t take value from them directly I’ve named them test1, test2). The only thing I know that tags will be between keyboard_arrow_down and keyboard_arrow_up.
I’ve tried with Get Source and than search with regexp, but without success. There is an example of code. Is there any other solution?
<!doctype html>
<html data-critters-container>
<head>
<meta charset="utf-8">
<title>keyboard_arrow_down</title>
<base href="/">
<meta name="viewport" content="width=1300px, maximum-scale=1.5">
<meta http-equiv="X-UA-Compatible" content="SHOULDN'T BE FOUND">
<Test2>SHOULD BE FOUND<Test3><Test2>
<Test>SHOULD BE FOUND</Test>
<noscript>
keyboard_arrow_up
</noscript>
Updated: I’ve managed to solve problem with Get Source and than search with regexp. But if you have a better solution I am eager to read it.
Do you have any control over the html? e.g. if it’s output from an internally developed app could you ask for the tags to have a known class or some other attribute added to them? That would make it much easier.
Failing that what you have might be the best solution.
Did you envision to use axis to get the tags?
For example, if you know the tags are after last meta, and prior to noscript, you could use condition with /following, /preceding, and Get Element Count to find them.
I have an element with text and links and this element has 14 different states. So there is a lot of possible combinations. One possible solution is to create 14 different keywords))))
Ok, I’ve overcomplicated the task. I’ve manage to solve it without regexp.
Just used Get WebElements with locator //p[@class=“balloon-text all-balloon-content”]//* It selected all tags that I need. Sorry for my strange question.