I am crawling a web site, trying to read the text in a couple of span elements, but i get NoSuchElementException: Message: Unable to locate element: .horse-764aj7-startlistraceinfodetails-styles--container I am assuming that this is because it is hidden by another element that has aria-hidden="true"

this is my code that causes the error

raceProp = driver.find_element(By.CLASS_NAME,"horse-764aj7-startlistraceinfodetails-styles--container")
spans = driver.find_elements(By.TAG_NAME,"span") 

this is the html

<div class="startlist-header__race-title">
  <div role="button" tabindex="0" class="race-info-toggle race-info-toggle--expanded" data-test-id="toggle-race-info">
    <svg viewBox="0 0 32 32" focusable="false" aria-hidden="true" class="horse-1r0kb3k-SvgIcon-styles--rootStyle-SvgIcon-styles--fontSize-startlistheader-styles--toggleIcon-SvgIcon--SvgIcon">
          <path d="M13.5 17.2c.7-.6 1.5-1 2.5-1s1.8.4 2.5 1l8.8 8.9c.7.7 1.1 1.5 1.1 2.4 0 .9-.4 1.8-1 2.5-.7.6-1.6 1-2.5 1-.9 0-1.8-.4-2.5-1L16 24.6 9.6 31c-.7.6-1.5 1-2.5 1s-1.8-.4-2.4-1c-1.4-1.4-1.4-3.6 0-4.9l8.8-8.9zM24.9 15.8c-.9 0-1.8-.3-2.5-1L16 8.4l-6.4 6.4c-.7.7-1.5 1-2.5 1-.9 0-1.8-.3-2.4-1-1.4-1.3-1.4-3.5 0-4.9l8.8-8.8c.7-.7 1.5-1 2.5-1s1.8.3 2.5 1l8.8 8.8c.7.7 1.1 1.6 1.1 2.5 0 .9-.4 1.8-1 2.4-.7.7-1.6 1-2.5 1z"></path>
    </svg>
  </div>
</div>

<div class="flexboxgrid2_col-xs-12_2A">
  <div data-test-id="startlist-info-container" class="horse-764aj7-startlistraceinfodetails-styles--container">
    <span class="horse-nqsei7-startlistraceinfodetails-styles--infoContainer-startlistraceinfodetails-styles--infoName-startlistraceinfodetails--StartlistRaceInfoDetails">Breddlopp - Sleipner Bergsåkers Månadstäcke - P21-lopp</span>
    <span class="horse-nxbcp8-startlistraceinfodetails-styles--infoContainer">Pris: 10.000-5.000-3.500-2.500-2.100-2.000-2.000-2.000 kr (8 priser). Lägst 1.500 kr till alla tävlande.</span>
  </div>
</div>

I have tried to click the button "toggle-race-info" (which makes the text visible on the web page), but I still get NoSuchElementException

0

There are 0 answers