title: How to click/select radio button with python/selenium
body: <p>I've been trying to automatize a report with python/selenium from a webpage. Right now I'm stock trying to select a radio button. Could you please help me with this issue, and if is possible some tips to make the code look/work better.</p>
  
  <p>I'm using XPath Helper to identify XPaths but I'm getting a "Null" value for this:</p>
  
  <pre><code>//*[@id="ctl00_ContentPlaceHolder1_rbUseSpecifiedDeviceConfiguration"]
  </code></pre>
  
  <p><strong>This is the error message that I get when I run the code:</strong></p>
  
  <pre><code>Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id='ctl00_ContentPlaceHolder1_rbUseSpecifiedDeviceConfiguration']"}
  </code></pre>
  
  <p><strong>webpage code</strong></p>
  
  <pre><code>&lt;div class="indent"&gt;
                      &lt;div&gt;
                          &lt;input id="ctl00_ContentPlaceHolder1_rbUseDeviceDefaultConfigurations" type="radio" name="ctl00$ContentPlaceHolder1$gnConfigurationType" value="rbUseDeviceDefaultConfigurations" checked="checked"&gt;&lt;label for="ctl00_ContentPlaceHolder1_rbUseDeviceDefaultConfigurations"&gt;Default Device Configurations&lt;/label&gt;
                      &lt;/div&gt;
                      &lt;div&gt;
  
                      &lt;/div&gt;
                      &lt;div&gt;
                          &lt;span class="hasValidation"&gt;&lt;input id="ctl00_ContentPlaceHolder1_rbUseSpecifiedDeviceConfiguration" type="radio" name="ctl00$ContentPlaceHolder1$gnConfigurationType" value="rbUseSpecifiedDeviceConfiguration" onclick="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$rbUseSpecifiedDeviceConfiguration\',\'\')', 0)"&gt;&lt;label for="ctl00_ContentPlaceHolder1_rbUseSpecifiedDeviceConfiguration"&gt;Specify Device Configuration...&lt;/label&gt;&lt;/span&gt;
                      &lt;/div&gt;
                      &lt;div class="indent"&gt;
  
                      &lt;/div&gt;
                      &lt;div&gt;
  
                      &lt;/div&gt;
                      &lt;div class="indent"&gt;
  
                      &lt;/div&gt;
                  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Python code</strong></p>
  
  <pre><code>import time
  from selenium import webdriver
  import selenium.webdriver.support.ui as ui
  from selenium.webdriver.common.keys import Keys
  
  #Opens Chrome driver and maximize window
  driver = webdriver.Chrome('C:\Python27\selenium\webdriver\chrome\chromedriver.exe')
  driver.maximize_window()
  
  # Username and password for webpage
  username = 'XXX'    #username to login in to web app
  password = 'YYY'    #Password to login in to web app
  
  # Gets webpage
  driver.get('https://www.XXX-YYY.com/')
  
  # Automatized script to get from main page to Trending
  search_box = driver.find_element_by_xpath("//*[@id='_GlobalLoginControl_UserLogin']")   # Fills username textBox
  search_box.send_keys(username)
  search_box = driver.find_element_by_xpath("//*[@id='_GlobalLoginControl_Password']")    # Fills password textBox
  search_box.send_keys(password)
  search_box = driver.find_element_by_xpath("//*[@id='_GlobalLoginControl_LoginBtn']")    # Click login Button
  search_box.click()
  time.sleep(2)
  search_box = driver.find_element_by_xpath("//*[@id='8:45']/ins")                        # treeBtn
  search_box.click()
  time.sleep(2)
  search_box = driver.find_element_by_xpath("//*[@id='8:218']/ins")                       # treeBtn
  search_box.click()
  time.sleep(2)
  search_box = driver.find_element_by_xpath("//*[@id='8:581']/ins")                       # Trending treeBtn
  search_box.click()
  time.sleep(2)
  search_box = driver.find_element_by_xpath("//*[@id='a8:583']")                          # tag
  search_box.click()
  time.sleep(6)
  search_box = driver.find_element_by_xpath("//*[@id='pageheading_menu_anchor']")             # Related pages dropDownList
  search_box.click()
  time.sleep(2)
  search_box = driver.find_element_by_xpath("//*[@id='pageheading_menu_anchor_panel_s1_l4']")         # Quick trending tag
  search_box.click()
  time.sleep(6)
  ##############################
  ### My issue is below this ###
  ##############################
  search_box = driver.find_element_xpath("//*[@id='ctl00_ContentPlaceHolder1_rbUseSpecifiedDeviceConfiguration']")        # Specify Device Configuration radioBtn
  search_box.click()
  time.sleep(2)
  search_box = driver.find_element_by_xpath("//*[@id='ctl00_ContentPlaceHolder1_DeviceTrendCfgSelector_ConfigurationListAnchor']/img")        # Select Configuration dropDownList
  search_box.click()
  time.sleep(2)
  search_box = driver.find_element_by_xpath("//*[@id='ctl00_ContentPlaceHolder1_DeviceTrendCfgSelector_ConfigurationList']/div/a[3]")         # 4 lease operator with memos and choke size
  search_box.click()
  </code></pre>