Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benibela/xidel
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 matching. It can also create new or transformed XML/HTML/JSON documents.
https://github.com/benibela/xidel
cli command-line css-selector curl data-processing datascraping html http httpie json rest scraper web webscraper webscraping wget xml xmlstarlet xpath xquery
Last synced: 2 days ago
JSON representation
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 matching. It can also create new or transformed XML/HTML/JSON documents.
- Host: GitHub
- URL: https://github.com/benibela/xidel
- Owner: benibela
- License: gpl-3.0
- Created: 2015-06-11T21:29:20.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-01-02T16:47:28.000Z (about 1 month ago)
- Last Synced: 2025-02-05T18:08:46.711Z (9 days ago)
- Topics: cli, command-line, css-selector, curl, data-processing, datascraping, html, http, httpie, json, rest, scraper, web, webscraper, webscraping, wget, xml, xmlstarlet, xpath, xquery
- Language: Pascal
- Homepage: http://www.videlibri.de/xidel.html
- Size: 2.54 MB
- Stars: 700
- Watchers: 28
- Forks: 43
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: changelog
- License: COPYING
Awesome Lists containing this project
- awesome-tools - benibela/xidel - 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 matching. It can also create new or transformed XML/HTML/JSON documents. (Command Line / Like jq)
README
Xidel [![Build Status](https://api.travis-ci.com/benibela/xidel.svg?branch=master)](https://travis-ci.com/benibela/xidel)
=============
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](http://www.videlibri.de/xidel.html).
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 simplerxidel 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](.travis.yml) script to download dependencies.