Answer the question
In order to leave comments, you need to log in
Selenium doesn't select from a list by variable. What to do?
The website has the following code:
<div class="form-group">
<label for="id_field_7089">1. Какова Ваша температура?</label>
<span data-required-id="id_field_7089">*</span>
<select name="field_7089" class="form-control" required="" id="id_field_7089">
<option value="" selected="">---------</option>
<option value="404">Нормальная</option>
<option value="405">Выше нормы</option>
</select>
</div>
q = driver.find_elements_by_class_name('form-control')
q_click = q[0]
time.sleep(1)
select = Select(q_click).select_by_visible_text(answers[0])
q_click = q[1]
time.sleep(1)
print(answers[0])
from selenium import webdriver
from selenium.webdriver.support.select import Select
q = driver.find_elements_by_class_name('form-control')
q_click = q[0]
time.sleep(1)
select = Select(q_click).select_by_visible_text('Нормальная')
q_click = q[1]
time.sleep(1)
print(answers[0])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question