cookiewrapper
Module¶
Wrappers that wrap instances to Python standard library.
Bases:
object
Wraps a CookieJar.
Parameters: - cookie_jar – An instance of
http.cookiejar.CookieJar
. - save_filename (str, optional) – A filename to save the cookies.
- keep_session_cookies (bool) – If True, session cookies are kept when saving to file.
Wrapped
add_cookie_header
.Parameters: - request – An instance of
http.request.Request
. - referrer_host (str) – An hostname or IP address of the referrer URL.
- request – An instance of
Save the cookie jar if needed.
Return the wrapped Cookie Jar.
Wrapped
extract_cookies
.Parameters: - response – An instance of
http.request.Response
. - request – An instance of
http.request.Request
. - referrer_host (str) – An hostname or IP address of the referrer URL.
- response – An instance of
- cookie_jar – An instance of
Bases:
object
Wraps a HTTP Response.
Parameters: response – An instance of http.request.Response
Return the header fields as a Message:
Returns: An instance of email.message.Message
. If Python 2, returns an instance ofmimetools.Message
.Return type: Message
Convert a HTTP request.
Parameters: - request – An instance of
http.request.Request
. - referrer_host (str) – The referrering hostname or IP address.
Returns: An instance of
urllib.request.Request
Return type: - request – An instance of