I am trying to automate a test script for a website
I have the following error
import urllib , urllib2 , cookielib , random ,datetime,time,sys
cookiejar = cookielib.CookieJar()
urlOpener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
urllib2.install_opener(urlOpener)
username=username.strip()
values = {'username': username, 'password': 'password'} #user input
data = urllib.urlencode(values)
request = urllib2.Request('http://141.168.25.182/',data)
url = urlOpener.open(request)
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/urllib2.py", line 364, in open
response = meth(req, response)
File "/usr/lib/python2.4/urllib2.py", line 471, in http_response
response = self.parent.error(
File "/usr/lib/python2.4/urllib2.py", line 402, in error
return self._call_chain(*args)
File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
result = func(*args)
File "/usr/lib/python2.4/urllib2.py", line 480, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden