按下硒python按钮

发布于 2025-02-12 03:08:03 字数 319 浏览 0 评论 0原文

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

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

我希望命令在Python中单击男性。

enter image description here

I want the bot to click on male
But I don't know how I tried to use this, but it didn't work for me

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

I want a command to make the bot click on male in Python.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幻想少年梦 2025-02-19 03:08:03

如果您想单击“男性”无线电按钮

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

If you want to click on 'Male' radio-button try

driver.find_element_by_xpath("//label[.='Male']/following-sibling::input[@name='sex']").click()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文