Use the HTML class attribute to locate elements in Selenium.
- [Instructor] Along with the methods that we've seen so far…we can also locate elements using the class attribute.…Let's take a look at this along with a code example.…The HTML class attribute specifies one or more…class names for an HTML element.…These class names are used to point to a calls…in a stylesheet.…Typically a class is used to group a number of elements…that have the same format or the same transition…or have the same form, color, or anything in common.…
We use this method to locate elements when we know…the class attribute of one or more elements.…The first element with a matching attribute value…will be returned.…Let's take a look at the HTML code…that we have been using so far.…So here, we have a heading element with a class, content.…So I'm going to copy this class name so that we can use it…in our code.…
Let's head over to the desktop where I'll go to the…Working Code folder, and I'll open the code…that we have been working with so far here.…Since we do not need multiple elements,…I'll delete the first two,…
- What is automated testing?
- Python-Selenium bindings
- Parsing the DOM structure
- Locating elements in the DOM
- Navigating and interacting with pages
- Explicit and implicit waits
Skill Level Intermediate
Learning Python GUI Programmingwith Burkhard Meier6h 6m Intermediate
Learning Python Web Penetration Testingwith Christian Martorella2h 49m Intermediate
1. What Is Automation Testing and Python-Selenium Framework?
2. Parsing the HTML DOM Structure
3. Navigating through Pages
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.