简体   繁体   中英

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.

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()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM