Get all attributes of an element (ChromeGetElementData>)

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Grovkillen
Automation Wizard
Posts: 1035
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Get all attributes of an element (ChromeGetElementData>)

Post by Grovkillen » Thu Apr 15, 2021 6:06 pm

If I want to get data from an element it's currently not possible to do so, except innerText and Value. I'd like to see this extend to include all data attributes. Especially the "dataset" (data-) attribute is useful. A json string would be ideal.

Let me know if you want me to give you some JS heads up on how to compile such a string :)
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Get all attributes of an element (ChromeGetElementData>)

Post by Marcus Tettmar » Mon Apr 19, 2021 1:51 pm

You can specify any attribute name:

https://www.mjtnet.com/manuals/v15/HTML ... tdata.html
item_type can be one of:
text - the inner text of the element
value - the value of the element if it has one (e.g. for inputs)
attribute/attribute_name - where attribute_name is a valid html attribute
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Grovkillen
Automation Wizard
Posts: 1035
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Get all attributes of an element (ChromeGetElementData>)

Post by Grovkillen » Mon Apr 19, 2021 1:53 pm

Oh!! Missed that! Thanks for pointing it out.
Let>ME=%Script%

Running: 15.0.24
version history

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts