0 votes
1 view
in Devops and Agile by (23.1k 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 (58.7k 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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...