Good evening my dear community. My question of tonight is following: I have this piece of HTML:
<option class="disabled" value="12_654" >
(EU 38 2/3 - US 6) </option>
<option class="disabled" value="12_3716" >
(EU 39 1/3 - US 6,5) </option>
<option class="disabled" value="12_636" >
(EU 40 - US 7) </option>
<option class="" value="12_634" >
EU 40 2/3 - US 7,5 </option>
<option class="" value="12_462" >
EU 41 1/3 - US 8 </option>
<option class="" value="12_460" >
EU 42 - US 8,5 </option>
<option class="" value="12_459" >
EU 42 2/3 - US 9 </option>
<option class="" value="12_458" >
EU 43 1/3 - US 9,5 </option>
<option class="" value="12_457" >
EU 44 - US 10 </option>
<option class="" value="12_456" >
EU 44 2/3 - US 10,5 </option>
<option class="" value="12_455" >
EU 45 1/3 - US 11 </option>
<option class="disabled" value="12_559" >
(EU 46 - US 11,5) </option>
<option class="disabled" value="12_454" >
(EU 46 2/3 - US 12) </option>
<option class="disabled" value="12_453" >
(EU 47 1/3 - US 12,5) </option>
</sel
it is just an example.... My goal is now to find the value of a specific size, by just giving the size. For example:
If I indicate my size is EU 40 - US 7 I want to be able to parse the value 12_636
I previously already used the bs4 module to parse HTML and to find specific values and I usually do it like this:
from bs4 import BeautifulSoup as bs
soup=bs(html.text, 'lxml')
v=soup.find('option',{'class':''})['value']
but here, because with the method above there would be more possible values, it is not what I need. I tried about adding the desidered size in the tag I want to find, but it did not work.
v=soup.find('option',(EU 40 - US 7),{'class':''})['value']
It looked like this, but yes I know, it is incorrect. Now I have absolutely no idea on how to find the value, so I would be really grateful on any help I get. Thanks a lot dear community!