Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selenium fields containing a word
#4
Yes, you can achieve this using Selenium in combination with Python. You can use the find_element_by_id method to locate the <select> elements by their id attribute, and then you can use the get_attribute method to retrieve the name attribute value.

Like this:-

month_select = driver.find_element_by_id("field_10_month")
day_select = driver.find_element_by_id("field_10_day")
year_select = driver.find_element_by_id("field_10_year")
month_name = month_select.get_attribute("name")
day_name = day_select.get_attribute("name")
year_name = year_select.get_attribute("name")
Reply


Messages In This Thread
Selenium fields containing a word - by graham23s - Jul-23-2019, 07:43 PM
RE: Selenium fields containing a word - by Gaurav_Kumar - Aug-22-2023, 12:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Registration Form Fields rwahdan 2 1,907 Aug-09-2022, 10:35 AM
Last Post: Addweb
  [Intermediate] Key Word Scrapper with Python and Selenium MIPython 0 5,775 Dec-21-2017, 03:35 PM
Last Post: MIPython
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,649 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