Python

How to Hit a Url with Python in One Line and Read the Response

Posted by stevenmarkford on October 28, 2010 at 10:27 pm

What I love about the Python programming language (see http://www.python.org) is how minimalistic it is. Below is an example of how to hit a URL and read the response (i.e. the html code that makes up the page) into a variable, in one line (two if you include the import line): import urllib2 response = [...]