Skip to content

API to extract data from HTML and XML documents

License

Notifications You must be signed in to change notification settings

danillab/selection

 
 

Repository files navigation

Selection

Travis CI

coveralls.io

API to query DOM tree of HTML/XML document.

Usage Example

Example:

from selection import XpathSelector
from lxml.html import fromstring

html = '<div><h1>test</h1><ul id="items"><li>1</li><li>2</li></ul></div>'
sel = XpathSelector(fromstring(html))
print(sel.select('//h1')).text()
print(sel.select('//li').text_list()
print(sel.select('//ul').attr('id')

Installation

Run:

pip install -U pip setuptools
pip install -U selection

Dependencies

  • lxml
  • tools
  • six

About

API to extract data from HTML and XML documents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.7%
  • Makefile 1.3%