title: Checking boxes using Xpath w/ Selenium
body: <p>I am creating a .py script to automate queries to the <a href="https://databank.worldbank.org/source/education-statistics" rel="nofollow noreferrer">World Bank data repository</a> using Selenium.</p>
  <p>The script will check boxes from the &quot;Countries&quot;, &quot;Series&quot;, and &quot;Time&quot; menus. I don't have problems selecting arrays of countries.</p>
  <pre><code>country_codes = ['AUT', 'BRA', etc.]
  for country in country_codes:
      country_xpath = '//*[@id=&quot;chk[Stat_Ctry_Ext].[List].&amp;[' + str(country) + ']&quot;]'
      driver.find_element_by_xpath(country_xpath).click()
  </code></pre>
  <p>However, selecting series raises a <code>NoSuchElementException</code> error.</p>
  <pre><code>driver.find_element_by_xpath('//*[@id=&quot;chk[STATS_Series_Ext].[Topic].&amp;[UIS.NERA.2.M]&quot;]')
  </code></pre>
  <p><a href="https://i.stack.imgur.com/AZhYG.png" rel="nofollow noreferrer">Image: Web Inspector</a></p>