【问题标题】:press a button with selenium python用 selenium python 按下一个按钮
【发布时间】:2022-06-30 23:12:50
【问题描述】:

我希望机器人点击男性 但我不知道我是如何尝试使用它的,但它对我不起作用

driver.find_element_by_xpath("//input[@name='sex']").click()

我想要一个命令让机器人在 Python 中点击男性。

【问题讨论】:

    标签: python selenium selenium-webdriver xpath webdriver


    【解决方案1】:

    如果你想点击“男性”单选按钮试试

    driver.find_element_by_xpath("//label[.='Male']/following-sibling::input[@name='sex']").click()
    

    【讨论】:

      猜你喜欢
      • 2021-02-14
      • 2018-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多