I am having problems with being able to select the RUC option in this software with selenium, the labels do not contain ids that differentiate them and the classes are the same:
I am using the following code but it doesn't work for me:
label_tipo_documento = driver.find_element_by_xpath('//div[@id="form-group-tipo_documento"]//div[@class="col-sm-3"]//label[@class="radio-inline"][2]')
print(label_tipo_documento.text)
label_tipo_documento.click()
I try to select the 2nd option within the labels [2] (RUC) and I get the following message:
NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@id="form-group-tipo_documento"]//div[@class="col-sm-3"]//label[@class="radio-inline"][2]"}
(Session info: chrome=87.0.4280.88)
However, when I do it with [1] instead of [2], it finds a value:
DNI