Find Text on a Webpage and Copy to a Variable

Hi All,

I like to find a text on a webpage in Chrome. The text and position varies per situation. When the text is found I want to double or triple click it to copy it in clipboard followed by placing it in a variable. I've looked quite some topics about it and think that I need to do a search on the following pagecode. In this sample the text to search is Test-Text. The text always starts with Test- :

Any help is appreciated.

Thanks!
-Neo

Ney @Neo,

That would be something like:

document.querySelector('div.field-item.dataValueRead').innerText

Run from an Execute a JavaScript in Front Browser action.

-Chris

Hey Chris,

Thanks again for your help. Unfortunately it doesn't give the text or any result I need back. The solution provided works perfectly if used on a random other sites. Unfortunately the page I need to acquire the info from is behind a login. I think about to go another route by scraping the text from the page and then filter the needed strings (are recognised by syntax) from the clipboard. So regex could be the way out of this. If you have any suggestions about this filtering part. Let me know.

Thanks!
-Neo

Not really – not without being able to see the page in question.

-Chris

Hey Chris, Thanks for your response. As I can not allow access to to the page or code I went the copy/scrape way and filtered the required bits and pieces by using regex.

Thanks,
-Neo

1 Like