-1
Hello,
I’m looking to automate a form that has 4 fields in which the only difference is the label. I’ve searched a lot, but I couldn’t find an answer that would help me. I’m automating with Selenium and Python. The HTML snippet I need to search has this structure:
<div class="formGroup"><label>Estado Expedidor RG<span class="danger"> * </span></label>
<select required="" class="ant-select ant-select-enabled ant-select-selection ant-select-selection--single dispatch_state"></select>
</div>
I would like to search by State Shipper RG. The search I did was as follows:
combobox_element = driver.find_element_by_css_selector('.formGroup .dispatch_state')
However, I can’t find the other fields that are in the same form, because they have the same attributes and classes informed above, differentiating only in the label. How can I add in the search I informed earlier, the label I want to use as reference. I know an id or even an attribute name would help, but it doesn’t have.
Thank you so much for your help and I’m sorry if I failed to inform you of any important information.