Abstract value of a select and I am working with beatifulsoup in python

0

I have the following html structure and I want to extract the value of the third option of the select with beatiful soup

<div class="box">
  <form id="busquedaFiltros" style="margin: 0;" class="form-horizontal" action="busquedaform.html" method="post">
    <div id="divCombos">
      <div id="djT">
        <label for="aparta">caserio<span class="msjError"> (*)</span></label>
      </div>
      <div id="djV">
        <select id="casas" name="casas" class="cuerpo6 form-control" onmouseover="this.style.cursor='pointer'">
          <option onmouseover="this.style.cursor='pointer'" value="">--Seleccionar</option>
          <option value="24454">casa1</option>
          <option value="43053">casa2</option>
          <option value="61095">casa3</option>
          <option value="83194">casa4</option>
        </select>

      </div>
      <div id="popup02f" style="visibility: hidden;">
        <span id="span01" onclick="popup02f()" onmouseover="this.style.cursor='pointer'"></span>
      </div>

and I have this in python but it does not return the expected value

soup = BeautifulSoup(r1.text, "html.parser") # Convertir de string a html
distrijudi = soup.find("select",id='casas').find("option",text='casa1')

print(distrijudi)
    
asked by lARAPRO 23.08.2018 в 22:06
source

0 answers