STS Blog

STS WebGet Released

February 3rd, 2007 by Jordan Del-Grande (Dedicated Page)

The first packaged release of WebGet is now available for download here. Briefly, WebGet is a Python Package interfacing urllib2 and handlers, cookielib, http and ntlm modules to provide for quick-turnaround applications.

To install just run “python setup.py install” using an administrative account.

To use just type import WebGet from your Python Interpreter or script. Here is a quick example:

import WebGet, os

# create a WebGet cookie
c = WebGet.WebGetCookie()
c.browsertype = WebGet.MOZILLA
c.path = os.path.join(os.environ["HOME"], "/.netscape/cookies.txt")

# create a WebGet instance
wg = WebGet.WebGet('http', 'www.securitytechscience.com', 80, c)

# set some variables
wg.add_header('Country','Australia')
wg.set_proxy('http', "127.0.0.1', 8080)

# request the page -> sets both a wg.request and wg.response value
wg.open('/')
print wg