Name of attributes of particular element?

15 views
Skip to first unread message

Anupam Patil

unread,
Jul 2, 2015, 3:06:57 AM7/2/15
to seleniu...@googlegroups.com
Is there any way to get all the name of attributes of particular webelement, not the attribute value???

Eldho Mathulla

unread,
Jul 2, 2015, 6:03:17 AM7/2/15
to seleniu...@googlegroups.com
I don't think there is a direct way from selenium to get all available attributes for an element. But you can use javascript to extract the list of attributes and attribute values of an element. You can check the link below for more details on how to you can extract attribute names via javascript.

On Tue, Jun 30, 2015 at 3:32 PM, Anupam Patil <anup...@gmail.com> wrote:
Is there any way to get all the name of attributes of particular webelement, not the attribute value???

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/962da066-e731-4895-b764-d47fa3573205%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
                ~L2~

Doug Dragon

unread,
Jul 2, 2015, 1:58:54 PM7/2/15
to seleniu...@googlegroups.com
"get_attribute" works pretty well in python:

element = driver.find_element_by_css_selector("css_of_element").get_attribute("name_of_attribute")


Hope that helps,
-Doug
Reply all
Reply to author
Forward
0 new messages