Skip to content
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.
Pascal Shell JavaScript Java XQuery Hack Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android fix support library version in build.gradle, because google's newest … Oct 10, 2017
examples fix typos Aug 25, 2017
meta fix lintian ? Apr 2, 2018
tests test case for unescaped nbsp May 23, 2019
web add optional callable actions (append ? to name) and function x:has-a… Mar 25, 2018
.hgtags update tags Apr 2, 2018
.travis.yml travis: use bionic Sep 21, 2019
COPYING clarify licenses Aug 25, 2017
README.md
_hg.filemap two days in and they ban my bot :( Dec 29, 2015
build.sh xidel meta Mar 30, 2018
cgi.css
cgi.js xidelcgi: js: highlighting for xpath/xquery 3 (ignore version number … Nov 2, 2013
changelog changelog Sep 11, 2019
install.sh update meta: version,manpage,web,build scripts Jun 8, 2016
manage.sh allow some build commands to fail Jan 4, 2019
printUsage.inc add clear-log, get-log functions Mar 18, 2018
readme.txt
xidel.lpi refactor output Apr 19, 2019
xidel.pas refactor output Apr 19, 2019
xidelbase.pas
xidelcgi.lpi fix/improve cgi tester Apr 20, 2019
xidelcgi.lpr
xidelcrt.pas refactor output Apr 19, 2019

README.md

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

Xidel on Linux Xidel on Windows

You can’t perform that action at this time.