阅读背景:

Selenium教程系列(五):xpath进阶_kingzhsh的博客

来源:互联网 

现在介绍xpath里,一些常用的函数,叫方法也行,一个意思。前面的网页案例,再改下源码

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Document</title>
 </head>
 <body>
 <ul style="list-style:none">
  <li><span>用户名:</span><input placeholder="8-12位字母数字" /></li>
  <li><span>密码:</span><input placeholder="6-16位字母数字" /></li>
  <li><span>验证码:</span><input placeholder="4位数字" /></li>
  <li><button>按钮</button></li>
 </ul>
  <script>
	document.getElementsByTagName('button')[0].onclick = function(){
		alert("haha");
	}
  </script>
 </body>
</html>
<



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: