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")
我试图找到并点击https://www.google.com/recaptcha/api2/demo中的验证码复选框
如果我没记错的话,它应该位于网站上的该范围之内
<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>
我尝试过按类和id搜索,但总是会出现错误。