Я пытаюсь автоматизировать жалобы в FCC. У меня проблемы с взаимодействием с выпадающим списком, расположенным по адресу https://consumercomplaints.fcc.gov/hc/en-us/requests/new?ticket_form_id=39744. Элементом является раскрывающийся список Проблемы с телефоном :
![enter image description here](https://i.stack.imgur.com/xdwsB.png)
HTML-код:
<div class="form-field string required request_custom_fields_22619354" >
<label id="request_custom_fields_22619354_label" for="request_custom_fields_22619354">Phone Issues</label>
<input type="hidden" name="request[custom_fields][22619354]" id="request_custom_fields_22619354" autocomplete="off" data-tagger="[{"label":"-","value":""},{"label":"Unwanted Calls (including do not call and spoofing)","value":"telemarketing_phone"},{"label":"Junk Faxes","value":"junk_faxes_phone"},{"label":"Availability","value":"availability_phone"},{"label":"Billing","value":"billing_phone"},{"label":"Cramming (unauthorized charges on your phone bill)","value":"cramming_phone"},{"label":"Equipment","value":"equipment_phone"},{"label":"Interference","value":"interference_phone"},{"label":"Number Portability (keeping your number if you change providers)","value":"number_portability_phone"},{"label":"Privacy","value":"privacy_phone"},{"label":"Rural Call Completion","value":"rural_call_completion_phone"},{"label":"Slamming (change of your carrier without permission)","value":"slamming_phone"}]" aria-required="true" aria-describedby="request_custom_fields_22619354_hint" aria-labelledby="request_custom_fields_22619354_label" />
<p id="request_custom_fields_22619354_hint">Please select the issue that best describes your complaint.</p>
</div>
Я хочу выбрать индекс 1 или текст Нежелательные звонки (в том числе не звонить и не подделывать) . (Индекс 0 - это текст с чертой).
Вот мои три попытки, но они приводят к исключениям:
dropdown_issue = driver.find_element_by_id("request_custom_fields_22619354")
# First try - ElementNotInteractableException
dropdown_issue.send_keys("Unwanted Calls");
# Second try - ElementNotInteractableException
dropdown_issue.send_keys(Keys.DOWN);
dropdown_issue.send_keys(Keys.DOWN);
dropdown_issue.send_keys(Keys.ENTER);
# Third try - 'WebElement' object has no attribute 'select_by_index'
dropdown_issue.select_by_index(1)
Я думаю, что мне нужно перейти к "nesty-вход ", который имеет стрелку вниз (но без имени или идентификатора). Я не уверен, как получить доступ к nesty-вводу.
Как выбрать нужный индекс для раскрывающегося списка?