Inject JS with output

activities

#1

Hello Forum;

Need help on how to get output from the script.

For example in selenium, I can write something like this ‘document.getElementById (“pageTitle” ).innerText’ and this will get all text within the ‘Id’.

Can the activity return inner text? How?

Thanks


#2

Have a look at get attribute. If it has to be through JS I think I can write an example tonight as I might already have it working in one of my robots


#3

Hi @Daemo

Have you looked into the activity called “Inject Js Script”?

It gives you the output as String.


#4

Thank for your reply. Using get attribute works but not for the right purpose.

I’m scanning through a long *** page. Searching by id is the best for now:sunglasses:


#5

Hello;

Yes, that’s what I want. I tried all trick but yet to get a meaningful text.

Can you please help?:blush:


#6

Here is the solution you are looking for test.zip (2.1 KB)

Just edit the selector of the target for the inject code to a webpage and it will return the innerHTML


#7

oh and remember to set the elementID variable to the ID you are looking for

If my post answered your question please mark my answer as solution :slight_smile:
Just look below my answer for this box


#8

Hello RJ;

That works like a charm. Man, you are the best. 50 stars for you:star2:.

You are part of the reason I dump ‘other rpa gear’ (no names). I always knew all problems may be solved here.

Posted an hour ago, went for break, came back and problem ceased to exist.

Thanks again man and keep it up.

Kind regards