0

i am making a simple project with selenium about making followers generator.But, i get stuck in a case that two button have same class name,i want to automatically press that button but every times i try it's take me to press first button that redirect me to login with facebook(second button is 'sign up' button that exactly i want to press)

see instagram and inspect sign up button and 'login with facebook' button you will notice that both button is using css name https://i.stack.imgur.com/UPSOp.png

  • This is happening due to classes assigned to the buttons. Assign ids to the button and you will get rid of that issue. If you want to assign classes only then give different names. – Rohan Rao May 30 '20 at 08:59

1 Answers1

0

There are different ways to reach the element so try Xpath to reach 'Sign up' button:-

.//button[contains(text(),'Sign up')]
Ghanshyam
  • 184
  • 8