Answer the question
In order to leave comments, you need to log in
How to extract text from drop down list and from open page?
There is a dropdown list with a certain number of options:
<option>1.0</option>
<option>2.0</option>
el = browser.find_element_by_xpath('')
opt = el.find_elements_by_tag_name("option")
for option in opt:
option.click()
Answer the question
In order to leave comments, you need to log in
one.
for option in opt:
option.click()
print option.get_attribute("value") #значение элемента
print option.text #текст элемента
opt = browser.find_element_by_xpath('//option[text()="2.0"]')
opt.click()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question