try this : >>> url = 'http://www.google.com' >>> proxy = {'http': 'http://username:passw...@proxy:port'} >>> content = urllib.urlopen(url, proxies = proxy).read()
Hopefully it should run without error. Second approach can be to check whether your environment variables are setup. $set will show you. If not the case set up your environment variable. HTH, ~l0nwlf On Sat, Feb 20, 2010 at 8:02 AM, MattB <mattbar...@gmail.com> wrote: > On Feb 19, 8:28 pm, Chris Rebert <c...@rebertia.com> wrote: > > On Fri, Feb 19, 2010 at 5:06 PM, MattB <mattbar...@gmail.com> wrote: > > > On Feb 19, 7:20 pm, MattB <mattbar...@gmail.com> wrote: > > >> On Feb 19, 6:02 pm, "Martin P. Hellwig" <martin.hell...@dcuktec.org> > > >> wrote: > > >> > On 02/19/10 21:48, MattB wrote: > > >> > > Hey all, > > > > >> > > I've been working on a program that accesses my school's password > > >> > > protected website and downloads directory names. I'm using > mechanize. > > > > >> > > Recently, the program has been unable to open the website, > returning > > >> > > the 'errno 61 connection refused' error. I presume the school's > server > > >> > > was blocking me because of many automated logins. > > > > >> > Being a former school BOFH, I can assure you that if I was annoyed > by > > >> > your 'misuse' I would have tracked you down and made you aware of > it. > > > > >> > > However, it turns out that I cannot now open ANY url from within > > >> > > Python on my computer using mechanize (or urllib for that matter). > > >> > > And I've tried in several places -- my place, a friend's place > (who > > >> > > also has comcast as an ISP) and the school -- but no dice, > constant > > >> > > errno 61's whenever I try to open a url. > > > > >> > As mentioned by Jonathan Gardener, this is most likely a proxy > gateway. > > > > >> > > The strangest thing about this is that firefox still works > flawlessly > > >> > > on any site. > > > > >> > Your system might have been centrally configure so that applications > are > > >> > aware of the proxy, firefox probably has been piggybacking on those > > >> > settings (as it should). Most platforms can be made aware of a proxy > by > > >> > a DHCP option send by the DHCP server (that is when you > automatically > > >> > get an IP address). > > > > >> > > Any suggestions would be greatly appreciated. > > <snip> > > > Breakthrough: > > > > > I tried switching from a wireless connection to my router, and instead > > > used an ethernet connection -- and now everything works. > > > > > Why would this make a difference? MAC address? Is it possible for an > > > external server to see my MAC address and block it? Clearly wasn't an > > > IP address issue! > > > > If you're using the campus network and depending on the exact network > > details, yes, they very likely can know your MAC address and thus > > block it. > > Since your Wi-Fi card and Ethernet card have different hardware MAC > > addresses, yes, switching would change your visible MAC address, thus > > circumventing any blocks based on it. > > > > Cheers, > > Chris > > -- > > Hi ACMS!http://blog.rebertia.com > > Chris, > > I'm using the network in my own apartment. Not the campus's. > Moreover, my mac's MAC address is different from the MAC address shown > by my router, but as I said I'm also blocked when using my friend's > wireless router at his apartment. > > So it must be my mac's MAC, and not the router's MAC, that's being > blocked, right? > > But ALSO -- is it my ISP that's blocking the mac's MAC (and not the > school), since I can't raise ANY url's from python when I'm on > wireless? > -- > http://mail.python.org/mailman/listinfo/python-list >
-- http://mail.python.org/mailman/listinfo/python-list