Regular Expressions are the most common way. http://docs.python.org/lib/module-re.html HTML parser is another http://docs.python.org/lib/module-htmllib.html