Selenium Python Tutorial #18 - Find Element by Tag Name or Class Name

preview_player
Показать описание
In this Selenium Python Tutorial, we will learn how to find Element by Tag name or Class name. Python Selenium has the methods to locate webelements using the tag name of class name attributes of any webelement on web page.

This tutorial will explain in details how to find element by class name or tag name in selenium python.

Help me in spreading the knowledge, please hit LIKE, SHARE, and SUBSCRIBE for the latest tutorials. More tutorial playlists below:

🔶 ENROL IN MANY FREE TRAININGS ON RCV ACADEMY PORTAL 🔶

🔶 FOLLOW US ON TWITTER 🔶

🔶 LIKE US ON FACEBOOK 🔶

🔶 OUR TUTORIAL WEBSITES 🔶

🔶 GET MY TRAININGS ON UDEMY 🔶

#SeleniumPythonTutorial #PythonSelenium #SeleniumPython #PythonSeleniumTutorial #SeleniumWebdriver #TestAutomation #SoftwareTesting #RcvAcademy #SoftwareTestingMentor

Join this channel to get access to perks:
Рекомендации по теме
Комментарии
Автор

thank you, thank you so much for explaining the "find by class" thing, watched 20+ videos on this topic and not one explained everything about it like you did.

ivicaivo
Автор

Thank you very much for your videos. If you use dark mode in oycharm that would be great sir.

gnaneshvemuri
Автор

Your videos are great, thank you very much!!

peterfconley
Автор

I agree, locating an element by tag or class name can be problematic because the locator may not be unique. Ruby for example will fail if the find statement finds multiple elements matching the locator and you need to use another method. Python, although it does not fail, find_element() provides the first element matching the locator, but Python also has a e.g., form_controls = driver.find_elements(By.CLASS_NAME, 'form-control') # which will return an array of elements that have that class name. Then you can use form_controls[1] to access the second element in the list if this is the element you want. See his next tutorial (sorry watching these in order)

Also in Manish's example, if you want to use that multiple class names he used, you need to replace the space with a period in the search string and then Python will find the element that matches the hierarchy of classes given.

dougm
Автор

Thank You,

any idea, what is difference between Chropath and selectorsHub chrome extension, Is there any extensions that are helpful for testing ?

hackwithharsha
Автор

Hii sir, some error come while running the problem.the error show missing 1 required positional argument:'self'

ashpakshaikh
Автор

You didn't provide a way to find a particular tag_name when there are multiple instances...

Matias-ehpn
Автор

Hi, I try to find the element by class name, but there are many elements with the same class name, how can I find the specific element? For example <div class="e-filtermenudiv e-icons e-icon-filter" _ngcontent-hbl-c3=""
<div class="e-filtermenudiv e-icons e-icon-filter" _ngcontent-hbl-c3=""

edinsonsanchez