How it works...

We have used Python's cookielib and set up a CookieJar and cj. The login data has been encoded using urllib.urlencode. urllib2 has a build_opener() method, which takes the predefined CookieJar with an instance of HTTPCookieProcessor() and returns a URL opener. We call this opener twice: once for the login page and once for the home page of the website. It seems that only one cookie, bb_session, was set with the set-cookie directive present in the page header. More information about cookielib can be found on the official Python documentation site at http://docs.python.org/2/library/cookielib.html. Cookielib has been replaced by http.cookiejar in Python 3. You may find more information on this at https://docs.python.org/3/library/http.cookiejar.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.51.228