python http 組件簡介

1. mechanize  html

https://pypi.python.org/pypi/mechanize/

中文簡介:基於urllib2,徹底兼容urllib2,提供瀏覽歷史,表單狀態,cookies等功能。

mechanize 0.2.5

Stateful programmatic web browsing. python

Stateful programmatic web browsing, after Andy Lester's Perl module WWW::Mechanize. web

mechanize.Browser implements the urllib2.OpenerDirector interface. Browser objects have state, including navigation history, HTML form state, cookies, etc. The set of features and URL schemes handled by Browser objects is configurable. The library also provides an API that is mostly compatible with urllib2: your urllib2 program will likely still work if you replace "urllib2" with "mechanize" everywhere. sql

Features include: ftp:, http: and file: URL schemes, browser history, hyperlink and HTML form support, HTTP cookies, HTTP-EQUIV and Refresh, Referer [sic] header, robots.txt, redirections, proxies, and Basic and Digest HTTP authentication. cookie

Much of the code originally derived from Perl code by Gisle Aas (libwww-perl), Johnny Lee (MSIE Cookie support) and last but not least Andy Lester (WWW::Mechanize). urllib2 was written by Jeremy Hylton. ide

2. pysqlite

中文簡介:sqlite3的python接口

pysqlite 2.6.3

DB-API 2.0 interface for SQLite 3.x ui

Python interface to SQLite 3 google

pysqlite is an interface to the SQLite 3.x embedded relational database engine. It is almost fully compliant with the Python database API version 2.0 also exposes the unique features of SQLite. url

google code ducument連接 https://code.google.com/p/pysqlite/wiki/Documentation spa

使用教程

sqlite3 — DB-API 2.0 interface for SQLite databases

https://pysqlite.readthedocs.org/en/latest/sqlite3.html

3. cookielib

功能:http客戶端cookie處理

http://docs.python.org/2/library/cookielib.html

The cookielib module defines classes for automatic handling of HTTP cookies. It is useful for accessing web sites that require small pieces of data – cookies – to be set on the client machine by an HTTP response from a web server, and then returned to the server in later HTTP requests.

Both the regular Netscape cookie protocol and the protocol defined by RFC 2965 are handled. RFC 2965 handling is switched off by default. RFC 2109 cookies are parsed as Netscape cookies and subsequently treated either as Netscape or RFC 2965 cookies according to the ‘policy’ in effect. Note that the great majority of cookies on the Internet are Netscape cookies. cookielib attempts to follow the de-facto Netscape cookie protocol (which differs substantially from that set out in the original Netscape specification), including taking note of the max-age and port cookie-attributes introduced with RFC 2965.

相關文章
相關標籤/搜索