At least a couple of options, the first using BeautifulSoup:
import urllib import BeautifulSoup
soup = BeautifulSoup.BeautifulSoup(urllib.urlopen("https://www.google.com")) print soup.title.string And the second one using lxml: import lxml.html t =...
I recently ran into the following problem: I needed to be able to display a list of users in a table that had a maximum of X columns. Since I could not find the solution on the Internet I decided to give it a try and here is my resulting template...
Straight from the PythonInfo Wiki:
>>> import operator >>> L = [('c', 2), ('d', 1), ('a', 4), ('b', 3)] >>> map(operator.itemgetter(0), L) ['c', 'd', 'a', 'b'] >>> map(operator.itemgetter(1), L) [2, 1, 4, 3]...
Here's how to, from a view, redirect to another URL passing parameters to it. For instance, to redirect the user to a certain page after login: return HttpResponseRedirect(reverse('dz_details', kwargs={'dz_id':dz.id})) This will lookup the 'dz_details'...