当前位置:网站首页>Position() function in XPath uses
Position() function in XPath uses
2022-07-06 07:37:00 【Sub Archaean hyperevolution】
Just want to get a few of the elements
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>welcome to my index</title>
</head>
<body>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
</ul>
</body>
</html>
How to get the third to sixth li label
//ul/li[position()>2][position()<5]
//position() Position in variable [2] Inside
Find time li The label is greater than two , Start with the third one , Then find four more li label
I have seen many people explain position() function , But I didn't say how this matched , My current understanding is like this .
Explain it. :
position()>2 It means to start from the third element
position()<5 It means take 4 Elements
So the combination of these two is to take the third and sixth labels
边栏推荐
- edge瀏覽器 路徑獲得
- Scala language learning-08-abstract classes
- qt颜色与字符串、uint相互转换
- 【线上问题处理】因代码造成mysql表死锁的问题,如何杀掉对应的进程
- Oracle column to row -- a field is converted to multiple rows according to the specified separator
- octomap averageNodeColor函数说明
- word怎么只删除英语保留汉语或删除汉语保留英文
- js对象获取属性的方法(.和[]方式)
- Leecode-c language implementation -15 Sum of three ----- ideas to be improved
- GET/POST/PUT/PATCH/DELETE含义
猜你喜欢
数字经济时代,如何保障安全?
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Sharing of source code anti disclosure scheme under burning scenario
Opencv learning notes 8 -- answer sheet recognition
链表面试题(图文详解)
Significance and measures of encryption protection for intelligent terminal equipment
Multi attribute object detection on rare aircraft data sets: experimental process using yolov5
leecode-C语言实现-15. 三数之和------思路待改进版
Oracle column to row -- a field is converted to multiple rows according to the specified separator
Solution: système de surveillance vidéo intelligent de patrouille sur le chantier
随机推荐
杰理之蓝牙设备想要发送数据给手机,需要手机先打开 notify 通道【篇】
OpenJudge NOI 2.1 1749:数字方格
Set picture annotation in markdown
Typescript indexable type
Luogu p1836 number page solution
How MySQL merges data
Do you really think binary search is easy
杰理之BLE【篇】
上线APS系统,破除物料采购计划与生产实际脱钩的难题
Ble of Jerry [chapter]
How can word delete English only and keep Chinese or delete Chinese and keep English
Ble of Jerry [chapter]
数字IC设计笔试题汇总(一)
Typescript interface and the use of generics
If Jerry needs to send a large package, he needs to modify the MTU on the mobile terminal [article]
Bugku CTF daily question: do you want seeds? Blackmailed
Ble of Jerry [chapter]
[MySQL learning notes 29] trigger
The way to learn go (I) the basic introduction of go to the first HelloWorld
剪映的相关介绍