使用 selenium 在下拉菜单中选择选项后在文本框中输入一个值 python

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

这个问题和我之前的post有关(link:). 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

之后,我还需要单击 "Calculate" 按钮。请帮我解决这个问题。

您可以使用以下 xpath 在文本框中输入值:

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

然后您可以使用以下 xpath 单击“提交”按钮:

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