import urllib2 response = urllib2.urlopen('http://www.yahoo.com') html = response.read() print html
Friday, February 16, 2007
How to grab a page using urllib2
I got this from http://www.voidspace.org.uk/python/articles/urllib2.shtml. It's easy. The next step is to learn basic authentication so I can get to my bank site and download my bank statements automatically.
Subscribe to:
Post Comments (Atom)
1 comment:
Anonymous said...
Nice, thanks.
But what if I want the web site this "visits" to recognize that I have a certain cookie on my system so that it knows I was there?
2/09/2007 5:11 AM
So Feng said...
You should use Mechanize which has cookie handling. See my later post for more information about Mechanize.
2/15/2007 7:45 PM
Post a Comment