Home > py-httputil

py-httputil

Py-httputil is a project mainly written in Python, it's free.

httputil.py

What is this

This module get some information from webpage.

  • The webpage is exist or not.
  • What is the webpage's content type.
  • Charset of the webpage.
  • Webpage's Content

Install

$ git clone git://github.com/yono/py-httputil.git
$ cd py-httputil
$ sudo python setup.py install

Usage

>> from httputil import HTTPUtil
>> hutil = HTTPUtil('http://twitter.com')

>> is_exist, url = hutil.is_exist()
>> print is_exist, url

>> content_type = hutil.get_content_type()
>> print content_type

>> charset = hutil.get_charset_from_header()
>> print charset
>> charset = hutil.get_charset_from_html()
>> print charset

>> html = hutil.get_html()
>> print html