https://github.com/peterhil/slurp
BeautifulSoup4 packaged into a command line tool
https://github.com/peterhil/slurp
bookmarks cli-utilities html-parsing netscape
Last synced: 4 months ago
JSON representation
BeautifulSoup4 packaged into a command line tool
- Host: GitHub
- URL: https://github.com/peterhil/slurp
- Owner: peterhil
- License: mit
- Created: 2015-05-24T10:47:12.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-24T20:35:46.000Z (about 11 years ago)
- Last Synced: 2025-11-30T17:50:59.078Z (7 months ago)
- Topics: bookmarks, cli-utilities, html-parsing, netscape
- Language: Python
- Size: 152 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
BeautifulSoup4_ packaged into a command line tool.
=================================================
For now this tool just parses `HTML tag soup`_ with BeautifulSoup4,
and writes out the results. This can help for example to properly parse
the structure of a Netscape bookmarks file, which omits many ending tags.
Installation
---------
From the Python package index (Pypi_):
(sudo) pip install beautifulsoup4-slurp
or from Github_:
git clone https://github.com/peterhil/slurp.git
cd slurp
(sudo) python setyp.py install
Usage
-----
Show help:
slurp -h
Parse with html5lib and pretty print into stdout:
slurp -i bookmarks.html -p 'html5lib' -y
Parse with lxml and pretty print into stdout:
slurp -i bookmarks.html -p 'lxml' -y
Write pretty-printed to output to file:
slurp -y -i bookmarks.html -o bookmarks_soup.html
Pipe into slurp:
echo 'Slurp!
Github' | slurp -y
.. _Github: https://github.com/peterhil/slurp/
.. _Pypi: http://pypi.python.org/pypi/beautifulsoup4-slurp
.. _Beautifulsoup4: http://www.crummy.com/software/BeautifulSoup/
.. _`HTML tag soup`: https://en.wikipedia.org/wiki/Tag_soup
License
------
Copyright (c) 2015, Peter Hillerström
All rights reserved. This software is licensed under MIT license.
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
.. image:: https://img.shields.io/pypi/v/beautifulsoup4-slurp.svg
:target: https://pypi.python.org/pypi/beautifulsoup4-slurp
.. image:: https://img.shields.io/pypi/dm/beautifulsoup4-slurp.svg
:target: https://pypi.python.org/pypi/beautifulsoup4-slurp
.. image:: https://img.shields.io/pypi/l/beautifulsoup4-slurp.svg
:target: https://pypi.python.org/pypi/beautifulsoup4-slurp