urlopen exception

Chris Rebert clp2 at rebertia.com
Sat Jan 10 17:32:24 EST 2009


On Sat, Jan 10, 2009 at 9:56 AM, asit <lipun4u at gmail.com> wrote:
> site="www.bput.org"
> payloads="<script>alert('xss')</script>"
> attack= urllib2.urlopen(site+payloads,80).readlines()
>
> according to my best knowledge, the above code is correct.
> but why it throws exceptio ????

Because it's not correct. It's trying to load
www.bput.org<script>alert('xss')</script> which is definitely not a
valid URL.
Also, you need to specify the protocol in the URL, i.e. http://

Cheers,
Chris

-- 
Follow the path of the Iguana...
http://rebertia.com



More information about the Python-list mailing list