# vim:ts=4:sts=4:sw=4:noet
-from lxml import etree
+from lxml import etree, html
import json
try:
import hashlib
self.can_download = False
def get_children(self):
+ if not self.children:
+ self.fill_children()
return self.children
+ def fill_children(self):
+ pass
+
def download(self):
raise NotImplemented
return open(filename)
+def grab_html(url, max_age):
+ f = urlopen(url, max_age)
+ doc = html.parse(f)
+ f.close()
+ return doc
+
def grab_xml(url, max_age):
f = urlopen(url, max_age)
doc = etree.parse(f)