Home > Mobile >  Selecting an item from a dropdown menu with Selenium and python
Selecting an item from a dropdown menu with Selenium and python

Time:10-28

I'm trying to develop a "bot" to make purchase faster on "zalando" website. For example, assume I want to buy this: enter image description here

In principle you will have to perform the following 3 steps:

locate the element that opens the size selection

This seems to be done with a button with the id picker-trigger and should work by just using:

buttonElement = driver.find_element_by_id('picker-trigger')
buttonElement.click()

locate the proper size inside the form enclosure of the size table

The table itself can be identified using the form with name name size-picker-form and the size row by using a span with the specific text:

sizeElement = driver.find_element_by_xpath('//form[@name="size-picker-form"]//span[text()="40"]')
sizeElement.click()

I hope this helps or at least points you in the right direction.

  • Related