xidel

A command line tool to download and extract data from HTML/XML pages or JSON-APIs, using CSS, XPath 3.0, XQuery 3.0, JSONiq or pattern templates. It can also create new or transformed XML/HTML/JSON documents.

Github星跟蹤圖

Xidel Build Status

Xidel is a command line tool to download and extract data from HTML/XML pages using CSS selectors, XPath/XQuery 3.0, as well as querying JSON files or APIs (e.g. REST) using JSONiq.

There are dependency-free binaries for Windows, Linux and Mac.

It is a wrapper around my Pascal Internet Tools (see repository internettools), so it supports XPath 2.0, XPath 3.0, XQuery 1.0, XQuery 3.0, JSONiq, CSS selectors and my own extensions/languages (e.g. pattern matching) and if you can compile that project, you can compile Xidel.

A simple example to return the titles of all pages linked by some starting page:

 xidel http://example.org --follow //a --extract //title

or simpler

 xidel http://example.org -f //a -e //title

The language can be explicitly chosen. For example

 xidel input.html --css 'a'
 xidel input.html --xpath '//a/@href'
 xidel input.html --xquery 'for $var in //a order by $var return $var'

returns all links, the target URI of each link or the text of all links alphabetically.

There are more examples on the above page with binaries, the github wiki and in the directory examples.

Screenshots

Compilation and Installation

You can compile it by calling build.sh and install it by calling build.sh -t. Alternatively you can compile it with the Lazarus IDE.

You can call the commands from the .travis.yml script to download dependencies.

主要指標

概覽
名稱與所有者benibela/xidel
主編程語言Pascal
編程語言Pascal (語言數: 11)
平台
許可證GNU General Public License v3.0
所有者活动
創建於2015-06-11 21:29:20
推送於2025-02-22 16:58:02
最后一次提交2025-02-22 17:57:28
發布數4
最新版本名稱Xidel_0.9.8 (發布於 )
第一版名稱Xidel_0.9 (發布於 )
用户参与
星數805
關注者數28
派生數44
提交數757
已啟用問題?
問題數117
打開的問題數20
拉請求數1
打開的拉請求數2
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?