第三章 資料解析 xpath語法

2021-10-04 13:34:05 字數 375 閱讀 2884

直接學習:

xpath語法

使用方式:

使用//獲取整個頁面當中的元素,然後寫標籤名,然後再寫謂語進行提取。比如:`

//title[@lang=

'en'

]

需要注意的知識點:

1、/和//的區別:/代表只獲取子節點,//獲取子孫節點,一般用//比較多,當然也要視情況而定。

2、contains :有時候某個屬性中包含了多個值,那麼可以使用contains函式,示例如下:

//title[contains(@lang,

'en'

)]

3、謂語中下標是從1開始的,而不是從0開始的。

第三章 資料解析 什麼是xpath

直接學習 什麼是xpath?xpath xml path language 是一門在xml和html文件中查詢資訊的語言,可用在xml和html文件中對元素和屬性進行遍歷。xpath開發工具 chrome外掛程式xpath helper firefox外掛程式try xpath xpath 節點 在...

第三章,檢索資料

select prod name from products 上述語句利用select 語句從products表中檢索乙個名為prod name的列,所需要的列名在select 關鍵字之後給出,from關鍵字指出從其中檢索資料的表名 select prod name,prod id,prod nam...

第三章 資料定義

建立資料庫 creat database 資料庫名稱 開啟資料庫 use 資料庫名稱 刪除資料庫 drop database 資料庫名稱 更改資料庫名字 sp renameedp 原資料庫名稱 更改後資料庫名稱 建立資料庫student,並開啟 create database student gou...