Skip to main content

High performance HTML parser built on lxml

Project description

https://secure.travis-ci.org/daniyalzade/pho.png

pho is a library built on lxml, and implements the [Beautiful Soup](http://www.crummy.com/software/BeautifulSoup/) apis. It is meant to be a drop in replacement for BS.

BS is an awesome library for parsing and navigating DOM. But, because it tries to do a lot, it exhibits fairly poor performance. See [this post](http://blog.dispatched.ch/2010/08/16/beautifulsoup-vs-lxml-performance/) to see that directly using lxml over soup could give up to 70x speed improvement.

Pho aims to ease the transition from soup to using pure lxml, by implementing a part of the soup API as thin wrapper on lxml. Though I don’t have rigorous benchmarks, I have seen 10-30x performance improvement from using pho.

Installation

To install requests, simply:

$ pip install pho

Pho tries to pip install lxml, and for lxml you will need the following packages installed in your system.

Usage

import pho import requests

Pho(requests.get(’http://google.com’).content).find(‘title’).get_text()

Source

You can see the code [here](https://github.com/daniyalzade/pho>)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pho-0.0.1.tar.gz (1.8 kB view details)

Uploaded Source

File details

Details for the file pho-0.0.1.tar.gz.

File metadata

  • Download URL: pho-0.0.1.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pho-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d060aac653d79ed0aba3cc98798ab3e6cb0e137305aa4efa6ae30dda6fbc5e88
MD5 2a6a85a97490c0dee36c61edc114241b
BLAKE2b-256 e04ff193b13701ba5b7c330993c5ffb52bf20984100957d2e24cd4bb4ff89ece

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page