1

https://www.n11.com/telefon-ve-aksesuarlari/cep-telefonu-aksesuarlari

In this web site, I am trying to click (next page button)

I want to catch this line

<a href="https://www.n11.com/telefon-ve-aksesuarlari/cep-telefonu-aksesuarlari?pg=3" class="next navigation"></a>

I am writing this code in program

data=driver.find_elements_by_class_name("next navigation")

My question is about this problem.. it is not working

Mate Mrše
  • 7,328
  • 9
  • 29
  • 68

1 Answers1

11

data=driver.find_elements_by_class_name() accepts only single class name.

class="next navigation" defines two classes, next and navigation.

So you are only able to search for next or for navigation like this:

data = driver.find_elements_by_class_name("next")
data = driver.find_elements_by_class_name("navigation")

To find a element by multiple class names use xpath or cssSelector: Find div element by multiple class names?

data = driver.findElement(By.cssSelector(".next.navigation"));
micharaze
  • 895
  • 7
  • 24