当前位置:网站首页>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
边栏推荐
- Mise en œuvre du langage leecode - C - 15. Somme des trois chiffres - - - - - idées à améliorer
- 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
- Do you really think binary search is easy
- Brief explanation of instagram operation tips in 2022
- HTTP cache, forced cache, negotiated cache
- 超级浏览器是指纹浏览器吗?怎样选择一款好的超级浏览器?
- Wonderful use of TS type gymnastics string
- [MySQL learning notes 30] lock (non tutorial)
- Opencv learning notes 8 -- answer sheet recognition
- octomap averageNodeColor函数说明
猜你喜欢
Games101 Lesson 7 shading 1 Notes
QT color is converted to string and uint
成为优秀的TS体操高手 之 TS 类型体操前置知识储备
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
Ble of Jerry [chapter]
Apache middleware vulnerability recurrence
智能终端设备加密防护的意义和措施
Simulation of Teman green interferometer based on MATLAB
[computer skills]
解决方案:智慧工地智能巡檢方案視頻監控系統
随机推荐
edge浏览器 路径获得
Oracle column to row -- a field is converted to multiple rows according to the specified separator
Key value judgment in the cycle of TS type gymnastics, as keyword use
Openjudge noi 2.1 1749: Digital Square
Set picture annotation in markdown
解决方案:智慧工地智能巡检方案视频监控系统
xpath中的position()函数使用
[MySQL learning notes 32] mvcc
Three no resumes in the software testing industry. What does the enterprise use to recruit you? Shichendahai's resume
Three treasures of leeks and Chinese men's football team
Ali's redis interview question is too difficult, isn't it? I was pressed on the ground and rubbed
Sharing of source code anti disclosure scheme under burning scenario
Luogu p4127 [ahoi2009] similar distribution problem solution
Fundamentals of C language 9: Functions
Ble of Jerry [chapter]
洛谷P4127 [AHOI2009]同类分布 题解
[cf gym101196-i] waif until dark network maximum flow
How can word delete English only and keep Chinese or delete Chinese and keep English
Is the super browser a fingerprint browser? How to choose a good super browser?
杰理之AD 系列 MIDI 功能说明【篇】