[Tutor] Using urllib to retrieve info
kent37 at tds.net
Mon Aug 8 19:48:42 CEST 2005
David Holland wrote:
> Sorry I should have put my code.
> This is what I wrote
> import urllib
> import urllib2
> f =
> newfile = open("newfile.html",'w')
> print 'finished'
> It runs fine but the file saved to disk is the
> information at : 'http://support.mywork.co.uk'
There is something strange with this site that has nothing to do with Python. Just playing around with the two URLs in Firefox I get different results by reloading the page. If I try loading the two URLs with curl, I get the same thing for both.
Possibly there is something going on with cookies; you might take a look at urllib2 and its support for cookies to see if you can get it working the way you want.
More information about the Tutor