What's the best way to clean variables' content stored with the storeText

I have a webpage for which the storeText on a table selector returns carriage lines, tabs and something else that prevent me to do anything other that a dump to a file.

I can’t even process the variable content with executeScript function as an error message saying “[error]
Unexpected token (1:28)” appears.

Any idea, on how to clean the text?


try this
.replace(/^\s*|\s*$/g, “”);

I might not have tried this I’ve specifically, but as soon as I was trying to access the variable content for manipulation, that’s when the error was raised

can you share webpage?

Page Is private, I mean it’s under a Google account, but if you have Google search console access for any site of yours (if any) you can test around any of the inner sections.
I was trying to pull out the pages detail area as I need to build a report on over 500 sites and can’t copy paste manually all of them

I dont have Google search console access

It’s free, you just need to register to maintain a site if you have one.
If not, would the html dump of the page work for you to support?

BTW the problem seems to be with this character here which generate the invalid token error message.
I tried to use the translate function at xpath selection, which works fine in the browser but not at execution level.

could be ui vision bug

try extracting HTML code and then strip the tags to get data using javascript.

may be first replace the character?

I’ll try replacing the character on the fly before assigning to the variable.
This is something I’ve not tested yet