Search code examples
pythonhtmlseleniumselenium-webdriverwebdriver

How to find element <label for="terms"> Python, selenium


I'm trying to click this button on this website. To get to it you start on https://fantasy5.com/football and once on the website you click on the login/signup button top right. then you are on the correct link and the button I am trying to press is the terms and privacy button in the signup section.

HTML SOURCE

Any advice on what code I should use to find it would be much appreciated.


Solution

  • If you are trying to select that checkbox, use this xpath - //div[contains(@class,'Checkbox')][1]. Below line worked for me.

    driver.find_element_by_xpath("//div[contains(@class,'Checkbox')][1]").click()