第三章 資料解析 什麼是xpath

2021-10-04 13:25:44 字數 285 閱讀 7223

直接學習:

什麼是xpath?

xpath(xml path language)是一門在xml和html文件中查詢資訊的語言,可用在xml和html文件中對元素和屬性進行遍歷。

xpath開發工具:

chrome外掛程式xpath helper

firefox外掛程式try xpath

xpath 節點

在xpath中,有七中型別的節點:元素,屬性,文字,命名空間,處理指標,注釋以及文件(根)節點,xml文件是被作為節點樹來對待的,樹的根被稱為文件節點或根節點。

第三章 資料解析 xpath語法

直接學習 xpath語法 使用方式 使用 獲取整個頁面當中的元素,然後寫標籤名,然後再寫謂語進行提取。比如 title lang en 需要注意的知識點 1 和 的區別 代表只獲取子節點,獲取子孫節點,一般用 比較多,當然也要視情況而定。2 contains 有時候某個屬性中包含了多個值,那麼可以使...

第三章,檢索資料

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...