Python 如何为selenium的HTML代码找到元素?
Python 如何为selenium的HTML代码找到元素?,python,selenium,xpath,css-selectors,robotframework,Python,Selenium,Xpath,Css Selectors,Robotframework,如何从这个HTML代码中找到搜索框的定位器?我尝试了所有可能的方法,但没有成功。有很多选择: XPath = "//input[@placeholder='Enter a question']" CSS = "[type='search']" ID = "rc_select_1" 要定位图元,可以使用以下任一方法: 使用css\u选择器: input.ant-input.ant-input-lg[placeholder='Enter
如何从这个HTML代码中找到搜索框的定位器?我尝试了所有可能的方法,但没有成功。有很多选择:
XPath = "//input[@placeholder='Enter a question']"
CSS = "[type='search']"
ID = "rc_select_1"
要定位图元,可以使用以下任一方法:
- 使用
:css\u选择器
input.ant-input.ant-input-lg[placeholder='Enter aquestion']
- 使用
:xpath
//input[@class='ant-input ant-input-lg' and @placeholder='Enter aquestion']