Search code examples
pythonselenium-webdrivertextbox

Enter a value in a text box after selecting options in dropdown menu using selenium python


This question is related to my previous post (link: click to view the previous post in Stackoverflow). After selecting the options for each dropdown menu the last option will pop up as a text box. I want to enter an integer on the textbox corresponds to "Area (In Hectare)" textbox. Screenshot is given here

After that, I need to click the "Calculate" button also. Please help me to solve this issue.


Solution

  • You can enter the value in the text box using the following xpath:

    driver.find_element_by_xpath("//input[contains(@placeholder,'Area')]").send_keys('1')
    

    And then you can click on the Submit button using the following xpath:

    driver.find_element_by_xpath("//button[@type='submit']").click()