How to deal with multiple select tags with Python Selenium? -


I have such a problem:

I have to configure all the options on the page with Selenium, Need to use the class select from cellinium. For example: Select

  = (select (driver.find_elements_by_css_selector ('select')) select.select_by_index (2)  

and I instead Nothing Found I think that selection only works with one element and what to do when I need to configure all this way? Thanks!

You can create a generator for that, so you can repeat the elements while wrapping:

  element in select = driver selection (ft. V)  

Or you can wrap them all:

  select = map (choose, driver.find_elements_by_css_selector ('select'))  

Comments