## 快速知识点

### 属性

//div[contains(@class, "input-group mb")] 表示匹配任意的 divclass 的属性值包含如下字符串 ：input-group mb

1. starts-with 顾名思义，匹配一个属性开始位置的关键字
2. contains 匹配一个属性值中包含的字符串
3. text（） 匹配的是显示文本信息，此处也可以用来做定位用

### 标签内容

https://stackoverflow.com/a/3655588/2000468

//*[text()[contains(.,’ABC’)]]

• is a selector that matches any element (i.e. tag) — it returns a node-set. The outer [] are a conditional that operates on each individual node in that node set — here it operates on each element in the document.

text() is a selector that matches all of the text nodes that are children of the context node — it returns a node set.

The inner [] are a conditional that operates on each node in that node set — here each individual text node. Each individual text node is the starting point for any path in the brackets, and can also be referred to explicitly as . within the brackets. It matches if any of the individual nodes it operates on match the conditions inside the brackets.

contains is a function that operates on a string. Here it is
passed an individual text node (.). Since it is passed the second text node in the <Comment> tag individually, it will see the ‘ABC’ string and be able to match it.