Python is easy! (Hitting a URL)
Posted April 19, 2005Amazing how complete the language of Python is. Here is a little snippet that is available all over the place on how to hit a URL and get the text back. Give it a try.
import urllib
sock = urllib.urlopen(“http://microsoft.com”)
htmlSource = sock.read()
sock.close()
print htmlSource
Tags: Python
Leave a Reply
You must be logged in to post a comment.