Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个性别表格,第一个按钮如下所示
name=radio_43
第二个按钮显示如下:
xpath=(//input[@name='radio_43'])[2]
为什么叫公司按钮radio_43,然后第二个它使用xpath。
radio_43
您的两个单选按钮都有名称“radio_43”。为了区分它们,Selenium 需要通过其 xpath 调用第二个。直接选择器name=radio_43只会拉第一个。