title: VBA Excel, Selenium - Loop through radio button values to find the selected value and print it
body: <p>I want to know which radio button option is selected.  I am looking for a way to loop through the radio button responses and print the one with checked = 'Checked'.  Everything I have tried returns all of the options or returns nothing.</p>
  <p>here is a snippet of the html
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;tr onmouseover="this.style.backgroundColor='#f46f66';" onmouseout="this.style.backgroundColor='#d3e2e5';" style="background-color: rgb(155, 300, 59);"&gt;
     &lt;td width="80%"&gt;Select a fruit&lt;/td&gt;&lt;td width="20%"&gt;  
        &lt;input type="radio" name="FruitOptions" value="Peach" checked="checked" disabled="disabled"&gt;Peach&lt;br&gt;         
        &lt;input type="radio" name="FruitOptions" value="Apple" disabled="disabled"&gt;Apple&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;input type="radio" name="FruitOptions" value="Orange" disabled="disabled"&gt;Orange&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I am using vba selenium to scrape a website for this information.</p>
  <p>Here is what I have tried</p>
  <pre><code>enter code here
             Chrome.Wait 100
                      
              Set seconds = Chrome.FindElementsByTag(&quot;tr&quot;)
  
              j = 2
              s = 2
              
              Set mysheet = Sheets(&quot;Sheet7&quot;)
              
  
                  For Each second In seconds
  
                  On Error Resume Next
                  
                  mysheet.Cells(j, s).Value = second.FindElementsByTag(&quot;td&quot;)(2).Text
                  
      
                      Set inputvs = second.FindElementsByTag(&quot;input&quot;)
                      
                           For Each inputv In inputvs
          
                              If inputv.Attribute(&quot;checked&quot;).Value = &quot;checked&quot; Then
  
               'This is where my issue is 
               'I want to print the value with the checked attribute            
  
                                  Debug.Print (inputv.Attribute(&quot;value&quot;))
                                  
                                  mysheet.Cells(j, s).Value = inputv.getAttribute(&quot;value&quot;)
                                  
                                
                              Else
                              
                                  Debug.Print (&quot;none&quot;)
                                  
                              End If
                           
                           Next
                          
  
  
                  j = j + 1
  
                  
                  Next
  </code></pre>