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