Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

How can I filter elements which have the same class?

<html>

 <body>

  <p class="content">Link1.</p>

</body>

<html>

<html>

 <body>

  <p class="content">Link2.</p>

</body>

<html>

1 Answer

0 votes
by (62.9k points)

You can try using class = "content" to get the list of all elements by using find_elements_by_class_name:

a=[]; a = driver.find_elements_by_class_name("content");

Then you can click on the link that you are looking for.

Browse Categories

...