Commits

Amirouche Boubekki committed 7784e9a

renamed the executable to less confusing

Comments (0)

Files changed (2)

bin/kkes

-#!/usr/bin/env python
-import argparse
-from urllib import urlopen
-
-#from isissef import parse
-
-
-parser = argparse.ArgumentParser(description='Print the content of an html file')
-parser.add_argument('url', help='Url of an html ressource.')
-parser.add_argument('--debug',
-                    dest='debug',
-                    action='store_true',
-                    help='Outputs the full structure of the page')
-args = parser.parse_args()
-
-file = urlopen(args.url)
-document = parse(file)
-
-if args.debug:
-    print document.__debug__()
-else:
-    print str(document)
+#!/usr/bin/env python
+import argparse
+import pprint
+
+from kkes import parse
+
+
+parser = argparse.ArgumentParser(description='Print the content of an html file')
+parser.add_argument('url', help='Url of an html ressource.')
+parser.add_argument('--debug',
+                    dest='debug',
+                    action='store_true',
+                    help='Outputs the full structure of the page')
+args = parser.parse_args()
+
+document = parse(args.url)  # the rendered tree *is* the document
+
+if args.debug:
+    document.pprint()
+else:
+    print unicode(document)