from selenium import webdriver
browser = webdriver.Chrome(r"C:\Users\PC\Desktop\selenium\chromedriver")
browser.get('https://www.google.com/recaptcha/api2/demo')
browser.find_element_by_id("recaptcha-anchor")
I'm trying to find and click on the captcha checkbox in https://www.google.com/recaptcha/api2/demo
If I'm not mistaken it should be located within this span on the website
<span class="recaptcha-checkbox goog-inline-block recaptcha-checkbox-unchecked rc-anchor-checkbox" role="checkbox" aria-checked="false" id="recaptcha-anchor" tabindex="0" dir="ltr" aria-labelledby="recaptcha-anchor-label"><div class="recaptcha-checkbox-border" role="presentation"></div><div class="recaptcha-checkbox-borderAnimation" role="presentation"></div><div class="recaptcha-checkbox-spinner" role="presentation"><div class="recaptcha-checkbox-spinner-overlay"></div></div><div class="recaptcha-checkbox-checkmark" role="presentation"></div></span>
I've tried searching by class and id but it always raises an error.