Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Locating elements via Selenium
#2
If you want the tag name:
print(itm.tag_name)
get_attribute from docs -
Quote:Gets the given attribute or property of the element.
meaning that if you do something like:
print(itm.get_attribute('class'))
the output would be:
Output:
nice-name
Reply


Messages In This Thread
Locating elements via Selenium - by peterjv26 - Oct-01-2020, 04:16 PM
RE: Locating elements via Selenium - by mlieqo - Oct-01-2020, 07:55 PM
RE: Locating elements via Selenium - by peterjv26 - Oct-02-2020, 07:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Selenium cant get elements from HTML(Rookie) Troop 1 2,241 Mar-31-2020, 03:37 AM
Last Post: Larz60+
  Selenium Random Elements Id and class AgileAVS 1 3,844 Mar-01-2020, 12:31 PM
Last Post: metulburr
  Selenium locating an element. JokerTux 3 2,794 Dec-28-2019, 08:50 AM
Last Post: snippsat
  Getting error when accessing elements in a modal window of an webpage using selenium sumandas89 3 8,834 Jul-13-2018, 10:44 AM
Last Post: mlieqo
  locating element with selenium after login sumandas89 1 3,728 Jan-15-2018, 02:40 PM
Last Post: metulburr
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,739 Nov-03-2017, 08:41 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020