I am writing a script to count the number of radio buttons on the webpage - https://docs.google.com/forms/d/e/1FAIpQLSeI8_vYyaJgM7SJM4Y9AWfLq-tglWZh6yt7bEXEOJr_L-hV1A/viewform?formkey=dGx0b1ZrTnoyZDgtYXItMWVBdVlQQWc6MQ But it always throws me an error The common identifier between all the radio button is the role-radio.
<div class="appsMaterialWizToggleRadiogroupEl exportToggleEl isCheckedNext" jscontroller="D8e5bc" jsaction="keydown:I481le;dyRcpb:dyRcpb;click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;" jsshadow="" aria-label="1" data-value="1" role="radio" aria-checked="false" aria-posinset="1" aria-setsize="5" tabindex="0"><div class="appsMaterialWizToggleRadiogroupInk exportInk"></div><div class="appsMaterialWizToggleRadiogroupInnerBox"></div><div class="appsMaterialWizToggleRadiogroupRadioButtonContainer"><div class="appsMaterialWizToggleRadiogroupOffRadio exportOuterCircle"><div class="appsMaterialWizToggleRadiogroupOnRadio exportInnerCircle"></div></div></div></div>
driver.get("https://docs.google.com/forms/d/e/1FAIpQLSeI8_vYyaJgM7SJM4Y9AWfLq-tglWZh6yt7bEXEOJr_L-hV1A/viewform?formkey=dGx0b1ZrTnoyZDgtYXItMWVBdVlQQWc6MQ")
ele=driver.find_elements_by_css_selector("input[role=radio]")
print(len(ele))
I am new to Selenium and this type of issues is really confusing. TIA