sourceExtract HTML mode

I have been looking at the command SourceExtract
https://ui.vision/rpa/docs/selenium-ide/sourceextract-sourcesearch
From the documentation and testing is basically looks for the source string between two plain text strings. What I do not get is why not look for the string between the actual source instead of searching for plan text.
2020-04-23_2359

Or is this possible and I missed something?

Note I used a picture of the code because the Post editor said I was posting with too many links…

Or is this possible and I missed something?

Yeah, it should work exactly like you want it to work.

For example sourceSearch | Tea $*</li> => finds text between Tea $ and "</li>

Thank you for your answer by why does a search like this <html* turn up no results?

I mean like this <html*</html

1 Like

Good question => investigating…

1 Like

The issue was that the * notation did not support line breaks. This is fixed with V5.6.5.

sourceExtract |<html*</html> works now.

* can match \n on Chrome/Edge now, but not Firefox. Firefox workaround: Use regular expression explicitly, something like regex=/<html(.|\n)*</html>/g

Dear @admin

If I only want to get th * element, what should I modify?
For example: If the source is:
<html url="https://www.google.com" </html>

when I use this:

sourceExtract | <html*</html> | i
echo | ${i} | green

it does echo all the thing, which is <html url="https://www.google.com" </html>

I only want to echo https://www.google.com, what should I modify, or what command should I add?

Thank you.

have you solved it out ?could you share the way to me ?thanks@kolor_blind

@jeff_lee

Yes, I solved it. But it’s not what I thought of at the first moment, but it works.
You need a executeScript_Sandbox command. In that command, you put in some Javascript command to chop off the others, so you can get the link at the end. You can learn how to use executeScript_Sandbox in here.

For example, in my example, I should use some substring or slice command to chop off the <html and </html> part. It depends on what sourceExtract pulls out, and then you decide what Javascript command to put in.

You could learn about Javascript a lot on https://www.w3schools.com/

thanks a lot :star_struck: :star_struck::star_struck::star_struck:star_struck: :star_struck::star_struck::star_struck: