如何编写用户名字段的以下兄弟 CSS/Xpath 表达式?
How to write following sibling CSS/Xpath expression of username field?
HTML代码:
<form autocomplete="on" xpath="1">
<div class="IiD88i _351hSN">
<input class="_2IX_2- VJZDxU" autocomplete="off" type="text" value="">
<span class="_36T8XR"></span>
我可以写这个://input[@type='text']
但是上面代码的“following sibling”CSS/xpath怎么写呢?
如果你想根据其兄弟节点获取 input
节点,请尝试:
//label[.='Enter Email/Mobile number']/preceding-sibling::input
HTML代码:
<form autocomplete="on" xpath="1">
<div class="IiD88i _351hSN">
<input class="_2IX_2- VJZDxU" autocomplete="off" type="text" value="">
<span class="_36T8XR"></span>
我可以写这个://input[@type='text']
但是上面代码的“following sibling”CSS/xpath怎么写呢?
如果你想根据其兄弟节点获取 input
节点,请尝试:
//label[.='Enter Email/Mobile number']/preceding-sibling::input