更新时间:2022-06-08 22:21:56
您可以使用 Selenium协议元素" 和一个回调函数,用于检查结果状态以确定是否找到了该元素.例如:
You can achieve this by using the Selenium protocol "element" and a callback function to check the result status to determine if the element was found. For example:
browser.element('css selector', '#advanced-search', function(result){
if(result.status != -1){
//Element exists, do something
} else{
//Element does not exist, do something else
}
});