|
@@ -595,3 +595,12 @@ func DataFormat(data string) string {
|
|
|
}
|
|
|
return data
|
|
|
}
|
|
|
+
|
|
|
+// 返回当前元素下一个元素的text 如果没有元素就直接返回空
|
|
|
+func MustNext2Text(page *rod.Page, xpath string) string {
|
|
|
+ x := MustElementXV(page, xpath)
|
|
|
+ if x == nil {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ return x.MustNext().MustNext().MustText()
|
|
|
+}
|