У нас вы можете посмотреть бесплатно How to select a value from drop down using selenium webdriver with python или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
In this video, I have taught how to select a value from the drop down using selenium webdriver with python. There are several ways and out of those two of the commonly used ways are using Select class and ActionChains. Select has some limitations and won't work in all cases so it's better to use ActionChains. In this video, I've used an example from Aliexpress and selecting a value from state dropdown. I have faced issue selecting a value for state dropdown using Select method (because html of dropdown doesn't have select and option tags for the values of the dropdown and in that case it wasn't working). Based on my experience and avoiding conflicts/issues it's best to use ActionChains. You can see the complete video to get an idea of how to use it while writing an automation script. For reference, pasting the code here as well: select_state = browser.find_element_by_xpath("/html/body/div[5]/div/div/ul/li[@title='Kuala Lumpur']") // to locate the element actions = ActionChains(browser) // define this in order to make it work actions.move_to_element(select_state).perform() // this will locate the value from backend and show it visibly on frontend actions.click().perform() // this click is to select the required value Feel free to post any questions in the comments section or share your feedback. If you like this video then subscribe my channel for more videos on commonly faced issues in selenium and how to resolve them. Thank you!