Select drop down value in Selenium



  • I want help in a little thing, Look this:

    63856850-63aa-41f5-9d5f-6f0cf1d45bf6-image.png

    I want to press the option named Boleto Bancario, but look the html

    e5ac21fb-2861-4d4c-8308-e7c858208251-image.png

    Than how I will press the second option with selenium PYTHON



  • Please Check the snippet.

    1. You can select by value
    from selenium import webdriver
    from selenium.webdriver.support.ui import Select
    driver = webdriver.Chrome(r'chromedriver.exe')
    driver.get('url')
    sct = Select(driver.find_element_by_id('idFormaPagamento'))
    
    sct.select_by_value('813640')
    
    1. You can select by index
    sct.select_by_index('1')
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2