-3

enter image description here

I am unable to click on the LinkedIn sign-in button. Can someone please guide me with what locator should I use? What should be the actual code.

I have tried

driver.find_element(By.CLASS_NAME,"btn__primary--large from__button--floating").click()

but that doesn't work

Jay Chavan
  • 1
  • 1
  • 1
  • 2
  • 1
    https://stackoverflow.com/questions/65347241/finding-element-to-click-in-html-with-selenium-and-python – Danielle M. Oct 26 '22 at 19:13
  • Does this answer your question? [Finding element to click in html with Selenium and Python](https://stackoverflow.com/questions/65347241/finding-element-to-click-in-html-with-selenium-and-python) – gre_gor Nov 26 '22 at 16:31

1 Answers1

1

CLASS_NAME accepts single class attribute while here there are 2: btn__primary--large and from__button--floating.
To locate element based on 2 class values you can use CSS Selector or XPath, as following:

driver.find_element(By.CSS_SELECTOR,".btn__primary--large.from__button--floating").click()

Or

driver.find_element(By.XPATH,"//*[@class='btn__primary--large from__button--floating']").click()
Prophet
  • 32,350
  • 22
  • 54
  • 79